После того как добавил скрипт в init.d, пытаюсь его запустить, но получаю ошибки.
sudo service ponzu-server start
Job for ponzu-server.service failed because the control process exited with error code. See "systemctl status ponzu-server.service" and "journalctl -xe" for details.
journalctl -xe:
Jan 28 19:12:22 cs67724 systemd[1]: ponzu-server.service: Unit entered failed state.
Jan 28 19:12:22 cs67724 systemd[1]: ponzu-server.service: Failed with result 'exit-code'.
Jan 28 19:12:22 cs67724 sudo[1069]: pam_unix(sudo:session): session closed for user root
Jan 28 19:12:30 cs67724 sudo[1095]: ponzu : TTY=pts/0 ; PWD=/home/ponzu/work ; USER=root ; COMMAND=/bin/journalctl -xe
Jan 28 19:12:30 cs67724 sudo[1095]: pam_unix(sudo:session): session opened for user root by ponzu(uid=0)
Jan 28 19:13:14 cs67724 sudo[1095]: pam_unix(sudo:session): session closed for user root
Jan 28 19:16:58 cs67724 sudo[1118]: ponzu : TTY=pts/0 ; PWD=/home/ponzu/work/src/remoteConfig/deployment/sysv ; USER=root ; COMM
Jan 28 19:16:58 cs67724 sudo[1118]: pam_unix(sudo:session): session opened for user root by ponzu(uid=0)
Может быть кто-то сталкивался с этим? Пытаюсь запустить эту cms -
https://github.com/ponzu-cms/ponzu, там есть вкладка deployment, делал по инструкции, хотя там описан не весь процесс.
Вот сам скрипт демона.
#!/bin/sh
### BEGIN INIT INFO
# Provides: ponzu-server
# Required-Start: $local_fs $network $named $time $syslog
# Required-Stop: $local_fs $network $named $time $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Description: Ponzu API & Admin server
### END INIT INFO
PROJECT_DIR=<PROJECT DIRECTORY>
SCRIPT='cd $PROJECT_DIR && ponzu --port=80 run'
RUNAS=<USER>
PIDFILE=/var/run/ponzu-server.pid
LOGFILE=/var/log/ponzu-server.log
start() {
if [ -f /var/run/$PIDNAME ] && kill -0 $(cat /var/run/$PIDNAME); then
echo 'Service already running' >&2
return 1
fi
echo 'Starting service…' >&2
local CMD="$SCRIPT &> \"$LOGFILE\" & echo \$!"
su -c "$CMD" $RUNAS > "$PIDFILE"
echo 'Service started' >&2
}
stop() {
if [ ! -f "$PIDFILE" ] || ! kill -0 $(cat "$PIDFILE"); then
echo 'Service not running' >&2
return 1
fi
echo 'Stopping service…' >&2
kill -15 $(cat "$PIDFILE") && rm -f "$PIDFILE"
echo 'Service stopped' >&2
}
uninstall() {
echo -n "Are you really sure you want to uninstall this service? That cannot be undone. [yes|No] "
local SURE
read SURE
if [ "$SURE" = "yes" ]; then
stop
rm -f "$PIDFILE"
echo "Notice: log file is not be removed: '$LOGFILE'" >&2
update-rc.d -f <NAME> remove
rm -fv "$0"
fi
}
case "$1" in
start)
start
;;
stop)
stop
;;
uninstall)
uninstall
;;
restart)
stop
start
;;
*)
echo "Usage: $0 {start|stop|restart|uninstall}"
esac