24 lines
726 B
Text
24 lines
726 B
Text
#!/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
|
|
|
|
}
|