# systemctl status gogs
● gogs.service - Gogs
Loaded: loaded (/etc/systemd/system/gogs.service; enabled; vendor preset: disabled)
Active: failed (Result: start-limit) since Sun 2019-07-07 13:57:28 JST; 3min 1s ago
Main PID: 3630 (code=exited, status=1/FAILURE)
Jul 07 13:57:28 git.example.com systemd[1]: gogs.service: main process exited, code=exited, status=1/FAILURE
Jul 07 13:57:28 git.example.com systemd[1]: Unit gogs.service entered failed state.
Jul 07 13:57:28 git.example.com systemd[1]: gogs.service failed.
Jul 07 13:57:28 git.example.com systemd[1]: gogs.service holdoff time over, scheduling restart.
Jul 07 13:57:28 git.example.com systemd[1]: start request repeated too quickly for gogs.service
Jul 07 13:57:28 git.example.com systemd[1]: Failed to start Gogs.
Jul 07 13:57:28 git.example.com systemd[1]: Unit gogs.service entered failed state.
Jul 07 13:57:28 git.example.com systemd[1]: gogs.service failed.
そこで以下の内容で systemd 用のファイルを新規作成します。
cat << EOF > /etc/systemd/system/gogs.service
[Unit]
Description=Gogs
After=syslog.target
After=network.target
[Service]
# Modify these two values and uncomment them if you have
# repos with lots of files and get an HTTP error 500 because
# of that
###
#LimitMEMLOCK=infinity
#LimitNOFILE=65535
Type=simple
User=git
Group=git
WorkingDirectory=/home/git/gogs
ExecStart=/home/git/gogs/gogs web
Restart=always
Environment=USER=git HOME=/home/git
[Install]
WantedBy=multi-user.target
EOF
[Unit]
Description=Gogs
After=syslog.target
After=network.target
After=mariadb.service mysqld.service postgresql.service memcached.service redis.service
[Service]
# Modify these two values and uncomment them if you have
# repos with lots of files and get an HTTP error 500 because
# of that
###
#LimitMEMLOCK=infinity
#LimitNOFILE=65535
Type=simple
User=git
Group=git
WorkingDirectory=/home/git/gogs
ExecStart=/home/git/gogs/gogs web
Restart=always
Environment=USER=git HOME=/home/git
# Some distributions may not support these hardening directives. If you cannot start the service due
# to an unknown option, comment out the ones not supported by your version of systemd.
ProtectSystem=full
PrivateDevices=yes
PrivateTmp=yes
NoNewPrivileges=true
[Install]
WantedBy=multi-user.target
コメント