Init commit

This commit is contained in:
santic-zombie
2022-07-03 11:40:01 +03:00
commit 2b9bed2e98
17 changed files with 527 additions and 0 deletions

36
opennebula-hem Normal file
View File

@@ -0,0 +1,36 @@
#!/sbin/openrc-run
name=$RC_SVCNAME
description="OpenNebula Hook Execution Service"
command="/usr/bin/ruby /usr/lib/one/onehem/onehem-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 $?
}