先去下载 https://natapp.cn/#download     linux 64位,放到 /usr/local

在/etc/systemd/system目录下新建 natapp.service
vi natapp.service

 

# Centos 7
# 存放位置 /usr/lib/systemd/system
# 开启 systemctl start natapp
# 关闭 systemctl stop natapp
# 开机启动 systemctl enable natapp
# 取消开机启动 system disable natapp

[Unit]
Description=NatApp Service
Wants=network-online.target
After=network.target

[Service]
Type=simple
ExecStart=/usr/local/natapp/natapp -authtoken=xxxxxx -log=stdout
# Suppress stderr to eliminate duplicated messages in syslog. NM calls openlog()
# with LOG_PERROR when run in foreground. But systemd redirects stderr to
# syslog by default, which results in logging each message twice.
StandardOutput=syslog
StandardError=null

[Install]
WantedBy=multi-user.target

 

设置权限:
chmod +777 natapp.service

设置开机启动:
systemctl enable natapp.service

立即启动:

systemctl start natapp.service

 

温馨提示: 本文最后更新于2023-09-14 14:53:19,某些文章具有时效性,若有错误或已失效,请在下方 留言或联系 www.88531.cn资享网
© 版权声明