Add SFTPGo init file for OpenRC
This commit is contained in:
parent
c2e1363021
commit
8fdd9e0b26
1 changed files with 24 additions and 0 deletions
24
install/sftpgo.openrc
Normal file
24
install/sftpgo.openrc
Normal file
|
@ -0,0 +1,24 @@
|
|||
#!/sbin/openrc-run
|
||||
|
||||
name=sftpgo
|
||||
cfgfile="/etc/sftpgo/sftpgo.toml"
|
||||
command="/usr/local/bin/sftpgo"
|
||||
command_args="serve --log-level info --log-max-age 1 --log-file-path /var/log/sftpgo/sftpgo.log"
|
||||
command_user="sftpgo"
|
||||
command_group="sftpgo"
|
||||
pidfile="/run/sftpgo.pid"
|
||||
command_background="yes"
|
||||
|
||||
depend() {
|
||||
need net
|
||||
}
|
||||
|
||||
start_pre() {
|
||||
checkpath --directory --owner $command_user:$command_group --mode 0700 /run/$RC_SVCNAME /var/log/$RC_SVCNAME
|
||||
}
|
||||
|
||||
start() {
|
||||
ebegin "Starting sftpgo"
|
||||
start-stop-daemon --stdout /var/log/sftpgo/sftpgo-out.log --stderr /var/log/sftpgo/sftpgo-err.log --background --start --exec /usr/local/bin/sftpgo --make-pidfile --pidfile $pidfile --user $command_user --group $command_group -- $command_args
|
||||
|
||||
}
|
Loading…
Reference in a new issue