systemd --user 配置

按照用户级别的方式运行systemd
将写好的.service文件拷贝到~/.config/systemd/user/,然后systemctl --user enable service
然后测试是否生效systemctl start --user service,按tab的时候应该会自动匹配配置的服务
.service文件示例

[Unit]
Description=DjnagoService
After=syslog.target

[Service]
ExecStart=/usr/local/bin/uwsgi --ini /some/directory/uwsgi.ini
# Requires systemd version 211 or newer
# RuntimeDirectory=uwsgi
Restart=always
KillSignal=SIGQUIT
Type=notify
StandardError=syslog
NotifyAccess=all

[Install]
WantedBy=multi-user.target

你可能感兴趣的:(systemd --user 配置)