我在以下系统文件单元中/etc/systemd/system/emacs.service
:
[Unit]
Description=Emacs: the extensible, self-documenting text editor
Documentatin=man:emacs(1) info:Emacs
[Service]
Type=forking
ExecStart=/usr/bin/emacs --daemon
ExecStop=/usr/bin/emacsclient --eval "(progn (setq kill-emacs-hook nil) (kill-emacs))"
Restart=always
Environment=DISPLAY=:%i
TimeoutStartSec=0
[Install]
WantedBy=default.target
我希望它在启动时开始,所以我已经进入 systemctl enable emacs
但是,每次我的服务重新启动时,都会systemctl status emacs
显示:
● emacs.service - Emacs: the extensible, self-documenting text editor
Loaded: loaded (/etc/systemd/system/emacs.service; disabled; vendor preset: enabled)
Active: inactive (dead)
但是然后输入systemctl start emacs
并检查状态返回:
● emacs.service - Emacs: the extensible, self-documenting text editor
Loaded: loaded (/etc/systemd/system/emacs.service; disabled; vendor preset: enabled)
Active: active (running) since Fri 2016-11-11 23:03:59 UTC; 4s ago
Process: 3151 ExecStart=/usr/bin/emacs --daemon (code=exited, status=0/SUCCESS)
Main PID: 3154 (emacs)
Tasks: 2
Memory: 7.6M
CPU: 53ms
CGroup: /system.slice/emacs.service
└─3154 /usr/bin/emacs --daemon
如何获得此过程以在启动时成功启动?
After=...
我提到的了。