Systemd unit, init script
This commit is contained in:
parent
7d1eeccf85
commit
c5e55fbcb9
27
txtdot.init
Normal file
27
txtdot.init
Normal file
@ -0,0 +1,27 @@
|
||||
#!/sbin/openrc-run
|
||||
|
||||
#export HOST=127.0.0.1
|
||||
#export PORT=8080
|
||||
#export REVERSE_PROXY=true
|
||||
|
||||
name=$RC_SVCNAME
|
||||
command="/usr/bin/node"
|
||||
command_args="./src/app.js"
|
||||
command_user="txtdot"
|
||||
directory="/home/txtdot/src/dist"
|
||||
|
||||
output_log="/var/log/$RC_SVCNAME/txtdot.log"
|
||||
error_log="/var/log/$RC_SVCNAME/error.log"
|
||||
|
||||
pidfile="/run/$RC_SVCNAME/$RC_SVCNAME.pid"
|
||||
stopsig="KILL"
|
||||
command_background="yes"
|
||||
|
||||
depend() {
|
||||
need net
|
||||
}
|
||||
|
||||
start_pre() {
|
||||
checkpath --directory --owner $command_user:$command_user --mode 0775 \
|
||||
/run/$RC_SVCNAME /var/log/$RC_SVCNAME
|
||||
}
|
13
txtdot.service
Normal file
13
txtdot.service
Normal file
@ -0,0 +1,13 @@
|
||||
[Unit]
|
||||
Description=txtdot proxy server
|
||||
After=network.target
|
||||
|
||||
[Service]
|
||||
User=txtdot
|
||||
Group=txtdot
|
||||
WorkingDirectory=/home/txtdot/src/dist
|
||||
ExecStart=/usr/bin/node ./src/app.js
|
||||
Restart=always
|
||||
|
||||
[Install]
|
||||
WantedBy=default.target
|
Loading…
x
Reference in New Issue
Block a user