码迷,mamicode.com
首页 > 其他好文 > 详细

systemd/services

时间:2015-03-13 19:07:07      阅读:431      评论:0      收藏:0      [点我收藏+]

标签:services   system   

Xvfb

Change the User= and Group= parameters:

/etc/systemd/system/xinit.service
[Unit]
Description=xinit with xvfb
After=network.target

[Service]
User=bitlbee
Group=bitlbee
ExecStart=/usr/bin/xvfb-run bash %h/.xinitrc

[Install]
WantedBy=multi-user.target

slock

Locks the system with the help of slock. Very handy when closing the laptop lid for example.

/etc/systemd/system/screenlock.service
[Unit]
Description=Lock X session using slock
Before=sleep.target
 
[Service]
User=<username>
Environment=DISPLAY=:0
ExecStart=/usr/bin/slock
 
[Install]
WantedBy=sleep.target

xautolock

Automatically lock the screen after a timeout of 10 minutes.

/etc/systemd/system/xautolock.service
[Unit]
Description=Lock the screen automatically after a timeout
 
[Service]
Type=simple
User=<username>
Environment=DISPLAY=:0
ExecStart=/usr/bin/xautolock -time 10 -locker slock -detectsleep
 
[Install]
WantedBy=graphical.target

ncdc

/etc/systemd/system/ncdc@.service
[Unit]
Description=ncdc
Requires=network.target local-fs.target

[Service]
Type=oneshot
RemainAfterExit=yes
KillMode=none
User=%I
ExecStart=/usr/bin/tmux new-session -s dcpp -n ncdc -d ncdc
ExecStop=/usr/bin/tmux send-keys -t dcpp:ncdc "/quit" C-m

[Install]
WantedBy=multi-user.target

Squeezelite

/etc/conf.d/squeezelite
server="<server>:<port>"   # amend as appropriate
name="<device_name>"       # amend as appropriate
mac="<your_mac_here>"      # amend as appropriate
device="default"           # amend as appropriate
logtype="all"
loglevel="info"
logfile="/var/log/squeezelite.log"
/etc/systemd/system/squeezelite.service
[Unit]
Description=Squeezelite Service
After=network.target

[Service]
Type=simple
EnvironmentFile=/etc/conf.d/squeezelite
ExecStart=/usr/bin/squeezelite -n ${name} -m ${mac} -d ${logtype}=${loglevel} -f ${logfile} -o ${device} -s ${server}
RestartSec=5
Restart=on-failure

[Install]
WantedBy=multi-user.target

See also


本文出自 “网络技术” 博客,请务必保留此出处http://xuago88.blog.51cto.com/897501/1620101

systemd/services

标签:services   system   

原文地址:http://xuago88.blog.51cto.com/897501/1620101

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!