I want to write a script of systemd for hexo to start it when system starts, but I don't know how to stop hexo server using commonds besides Ctrl-C.
Here is an exmaple
[Unit]
Description=Hexo Server
[Service]
Type=simple
ExecStart=/bin/hexo server
ExecStop=/bin/kill -TERM $MAINPID
ExecReload=/bin/kill -HUP $MAINPID
Restart=on-failure
WorkingDirectory=/path/to/your/website
[Install]
WantedBy=multi-user.target
WantedBy=graphical.target
$ sudo systemctl daemon-reload
$ sudo systemctl enable hexo.service
$ sudo systemctl start hexo.service
$ sudo systemctl status hexo.service
$ sudo systemctl stop hexo.service
$ sudo systemctl status hexo.service
我去……兄弟原来是天朝的啊……查英语把我累的 _(:з」∠❀)_
Thanks a lot!
Most helpful comment
我去……兄弟原来是天朝的啊……查英语把我累的 _(:з」∠❀)_