Add SFTPGo init file for OpenRC

This commit is contained in:
Miraty 2023-05-03 00:54:30 +02:00
parent c2e1363021
commit 8fdd9e0b26

24
install/sftpgo.openrc Normal file
View 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
}