You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
37 lines
855 B
37 lines
855 B
2 years ago
|
#!/sbin/openrc-run
|
||
|
|
||
|
name=$RC_SVCNAME
|
||
|
description="OpenNebula Flow Service"
|
||
|
command="/usr/bin/ruby /usr/lib/one/oneflow/oneflow-server.rb"
|
||
|
command_user="oneadmin:oneadmin"
|
||
|
pidfile="/run/one/${RC_SVCNAME}.pid"
|
||
|
supervisor="supervise-daemon"
|
||
|
|
||
|
depend() {
|
||
|
after syslog networking netmount opennebula
|
||
|
}
|
||
|
|
||
|
start_pre() {
|
||
|
/bin/mkdir -p /var/log/one
|
||
|
/bin/mkdir -p /var/lock/one
|
||
|
/bin/mkdir -p /run/one
|
||
|
/bin/chown $command_user -R /var/log/one /run/one /var/lock/one
|
||
|
}
|
||
|
|
||
|
start() {
|
||
|
ebegin "Starting $RC_SVCNAME"
|
||
|
start-stop-daemon --background \
|
||
|
--exec $command \
|
||
|
--make-pidfile --pidfile $pidfile --user $command_user \
|
||
|
--start
|
||
|
eend $?
|
||
|
}
|
||
|
|
||
|
stop() {
|
||
|
ebegin "Stopping $RC_SVCNAME"
|
||
|
start-stop-daemon --stop \
|
||
|
--exec $command \
|
||
|
--pidfile $pidfile --user $command_user
|
||
|
eend $?
|
||
|
}
|