parent
f67fedc4ac
commit
27db916569
@ -0,0 +1,15 @@
|
||||
#!/sbin/openrc-run
|
||||
|
||||
name="OpenNebula forced run"
|
||||
|
||||
depend() {
|
||||
use one-context one-context-local
|
||||
keyword -stop -shutdown
|
||||
}
|
||||
|
||||
start() {
|
||||
ebegin "Starting one-context-force"
|
||||
export TIMEOUT=0
|
||||
/usr/sbin/one-context-run force
|
||||
eend $?
|
||||
}
|
@ -0,0 +1,44 @@
|
||||
#!/bin/bash
|
||||
|
||||
# -------------------------------------------------------------------------- #
|
||||
# Copyright 2010-2017, OpenNebula Systems #
|
||||
# #
|
||||
# Licensed under the Apache License, Version 2.0 (the "License"); you may #
|
||||
# not use this file except in compliance with the License. You may obtain #
|
||||
# a copy of the License at #
|
||||
# #
|
||||
# http://www.apache.org/licenses/LICENSE-2.0 #
|
||||
# #
|
||||
# Unless required by applicable law or agreed to in writing, software #
|
||||
# distributed under the License is distributed on an "AS IS" BASIS, #
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
|
||||
# See the License for the specific language governing permissions and #
|
||||
# limitations under the License. #
|
||||
#--------------------------------------------------------------------------- #
|
||||
|
||||
### BEGIN INIT INFO
|
||||
# Provides: one-context-force
|
||||
# Required-Start: one-context-local one-context
|
||||
# Required-Stop:
|
||||
# Should-Start: $time
|
||||
# Should-Stop:
|
||||
# Default-Start:
|
||||
# Default-Stop: 0 1 2 3 4 5 6
|
||||
# Short-Description: OpenNebula forced run
|
||||
### END INIT INFO
|
||||
|
||||
. /lib/lsb/init-functions
|
||||
|
||||
case "$1" in
|
||||
start)
|
||||
export TIMEOUT=0
|
||||
log_daemon_msg $"Starting OpenNebula forced reconfiguration"
|
||||
/usr/sbin/one-context-run force
|
||||
log_end_msg $?
|
||||
;;
|
||||
*)
|
||||
log_action_msg $"Usage: $0 {start}"
|
||||
exit 2
|
||||
esac
|
||||
|
||||
exit $?
|
@ -0,0 +1,47 @@
|
||||
#!/bin/bash
|
||||
|
||||
# -------------------------------------------------------------------------- #
|
||||
# Copyright 2010-2017, OpenNebula Systems #
|
||||
# #
|
||||
# Licensed under the Apache License, Version 2.0 (the "License"); you may #
|
||||
# not use this file except in compliance with the License. You may obtain #
|
||||
# a copy of the License at #
|
||||
# #
|
||||
# http://www.apache.org/licenses/LICENSE-2.0 #
|
||||
# #
|
||||
# Unless required by applicable law or agreed to in writing, software #
|
||||
# distributed under the License is distributed on an "AS IS" BASIS, #
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
|
||||
# See the License for the specific language governing permissions and #
|
||||
# limitations under the License. #
|
||||
#--------------------------------------------------------------------------- #
|
||||
|
||||
# chkconfig: - 99 1
|
||||
# description: OpenNebula forced run
|
||||
|
||||
### BEGIN INIT INFO
|
||||
# Provides: one-context-force
|
||||
# Required-Start: one-context-local one-context
|
||||
# Required-Stop:
|
||||
# Should-Start: $time
|
||||
# Should-Stop:
|
||||
# Default-Start:
|
||||
# Default-Stop: 0 1 2 3 4 5 6
|
||||
# Short-Description: OpenNebula forced run
|
||||
### END INIT INFO
|
||||
|
||||
# Source function library.
|
||||
. /etc/rc.d/init.d/functions
|
||||
|
||||
case "$1" in
|
||||
start)
|
||||
export TIMEOUT=0
|
||||
action $"Starting OpenNebula forced reconfiguration: " \
|
||||
/usr/sbin/one-context-run force
|
||||
;;
|
||||
*)
|
||||
echo $"Usage: $0 {start}"
|
||||
exit 2
|
||||
esac
|
||||
|
||||
exit $?
|
@ -0,0 +1,9 @@
|
||||
description "OpenNebula forced run"
|
||||
author "OpenNebula Systems <support@opennebula.systems>"
|
||||
|
||||
manual
|
||||
task
|
||||
|
||||
env TIMEOUT=0
|
||||
|
||||
exec /usr/sbin/one-context-run force
|
@ -1,3 +1,13 @@
|
||||
# On NIC hogplug the delayed reconfiguration is triggered.
|
||||
SUBSYSTEM=="net", ACTION=="add", \
|
||||
RUN+="/sbin/service one-context-reconfigure-delayed start"
|
||||
|
||||
# Handle disk resize
|
||||
SUBSYSTEM=="block", ACTION=="change", \
|
||||
ENV{RESIZE}=="1", \
|
||||
RUN+="/sbin/service one-context-force start"
|
||||
|
||||
# Handle swap hot-attach
|
||||
SUBSYSTEM=="block", ACTION=="add", \
|
||||
ENV{ID_FS_TYPE}=="swap", \
|
||||
RUN+="/sbin/service one-context-force start"
|
||||
|
@ -0,0 +1,12 @@
|
||||
[Unit]
|
||||
Description=OpenNebula forced reconfiguration
|
||||
After=one-context.service
|
||||
Requisite=one-context.service
|
||||
|
||||
[Service]
|
||||
Type=oneshot
|
||||
Environment=TIMEOUT=0
|
||||
ExecStart=/usr/sbin/one-context-run force
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
Loading…
Reference in new issue