首页 > 其他 > 详细

systemd/services

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

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

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

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!