Saya memiliki file unit systemd berikut di /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
Saya ingin ini dimulai saat boot, jadi saya sudah masuk systemctl enable emacs
Namun, setiap kali layanan saya reboot, systemctl status emacs
menunjukkan:
● emacs.service - Emacs: the extensible, self-documenting text editor
Loaded: loaded (/etc/systemd/system/emacs.service; disabled; vendor preset: enabled)
Active: inactive (dead)
Tetapi kemudian memasukkan systemctl start emacs
dan memeriksa status kembali:
● 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
Bagaimana saya bisa membuat proses ini berhasil dimulai saat boot?
After=...
saya sebutkan.