首页 > 其他 > 详细

gogs开机自启服务设置

时间:2020-08-11 16:02:04      阅读:256      评论:0      收藏:0      [点我收藏+]
$ sudo cp /gogs/scripts/systemd/gogs.service /lib/systemd/system/
$ sudo vi /lib/systemd/system/gogs.service
--------------------------------

$ cat /lib/systemd/system/gogs.service
[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=user_name
Group=user_group
WorkingDirectory=/home/user_name/tools/gogs
ExecStart=/home/user_name/tools/gogs/gogs web
Restart=always
Environment=USER=user HOME=/home/user

# 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
--------------------------------

$ sudo systemctl daemon-reload
$ sudo systemctl enable gogs

gogs开机自启服务设置

原文:https://www.cnblogs.com/Serendipity2020/p/13475609.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!