centos配置gogs开机自启
gogs下载:https://gogs.io/docs/installation/install_from_binary
gogs提供的压缩包 提供了service文件,路径:
/scripts/systemd/gogs.service
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=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
根据自己的情况进行修改,然后将gogs.service cp到 /usr/lib/systemd/system/ 目录下
启动:
systemctl start gogs.service
开机自启:
systemctl enable gogs.service
版权声明:
作者:东明兄
链接:https://blog.crazyming.com/note/2952/
来源:CrazyMing
文章版权归作者所有,未经允许请勿转载。
共有 0 条评论