Skip to content
This repository was archived by the owner on Jan 16, 2024. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion generate.sh
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ while IFS= read -r -d $'\0' SRC; do
done
fi

# file matches
# file matches
DST=${SRC%##*} #strip tags
mkdir -p "${BUILD_DIR}/$(dirname "${DST}")"
cp "src/${SRC}" "${BUILD_DIR}/${DST}"
Expand Down Expand Up @@ -113,6 +113,7 @@ else
--rpm-summary "${SUMMARY}" \
${DEPENDS:+ --depends ${DEPENDS// / --depends }} \
--replaces "${REPLACES}" \
--conflicts "${REPLACES}" \
--package "${OUT}"
fi

Expand Down
40 changes: 22 additions & 18 deletions postinstall.one
Original file line number Diff line number Diff line change
Expand Up @@ -23,19 +23,23 @@ rm -f /etc/udev/rules.d/70-persistent-net.rules
udevadm control --reload >/dev/null 2>&1 || :

# Register service
if [ -f /etc/init.d/vmcontext ]; then
if which systemctl >/dev/null 2>&1 && \
[ -d /etc/systemd ] && \
[ -f /usr/lib/systemd/system/one-context.service ];
then
systemctl enable one-context-local.service
systemctl enable one-context.service
fi

if [ -f /etc/init.d/one-context ]; then
if [ -d /etc/sysconfig/network-scripts ]; then
chkconfig --add vmcontext
chkconfig --add one-context-local
chkconfig --add one-context
elif [ -d /etc/network ]; then
update-rc.d vmcontext defaults 9 99
else
echo 'WARNING: Contextualization service not enabled' >&2
fi
elif [ -d /etc/systemd ]; then
if [ -f /usr/lib/systemd/system/one-context-local.service -a\
-f /usr/lib/systemd/system/one-context.service ]; then
systemctl enable one-context-local.service
systemctl enable one-context.service
for S in one-context-local one-context; do
update-rc.d ${S} enable >/dev/null 2>&1
update-rc.d ${S} defaults >/dev/null 2>&1
done
else
echo 'WARNING: Contextualization service not enabled' >&2
fi
Expand All @@ -53,19 +57,19 @@ EOT
rm -rf /etc/network/interfaces.d

# Do not reconfigure network interfaces on boot
if [ -f /etc/default/networking ]; then
if ! grep -q ^CONFIGURE_INTERFACES /etc/default/networking; then
echo 'CONFIGURE_INTERFACES=no' >> /etc/default/networking
fi
fi
# if [ -f /etc/default/networking ]; then
# if ! grep -q ^CONFIGURE_INTERFACES /etc/default/networking; then
# echo 'CONFIGURE_INTERFACES=no' >> /etc/default/networking
# fi
# fi

# Remove ttyS* from the grub
if [ -f /etc/default/grub ]; then
sed -i 's/console=ttyS0//g' /etc/default/grub
sed -i 's/console=ttyS[a-zA-Z0-9,]*//g' /etc/default/grub
fi

if [ -f /boot/grub/grub.cfg ]; then
sed -i 's/console=ttyS0//g' /boot/grub/grub.cfg
sed -i 's/console=ttyS[a-zA-Z0-9,]*//g' /boot/grub/grub.cfg
fi
fi

Expand Down
15 changes: 12 additions & 3 deletions preuninstall.one
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,17 @@
#--------------------------------------------------------------------------- #

# Unregister service
if [ -d /run/systemd/system/ ]; then
/bin/systemctl --no-reload disable one-context-local.service one-context.service >/dev/null 2>&1 || :
/bin/systemctl daemon-reload >/dev/null 2>&1 || :
if [ -d /etc/system/ ]; then
systemctl --no-reload disable one-context-local.service one-context.service >/dev/null 2>&1 || :
systemctl daemon-reload >/dev/null 2>&1 || :
fi

if [ -f /etc/init.d/one-context ]; then
if [ -d /etc/sysconfig/network-scripts ]; then
chkconfig --del one-context >/dev/null 2>&1 || :
chkconfig --del one-context-local >/dev/null 2>&1 || :
elif [ -d /etc/network ]; then
update-rc.d -f one-context remove >/dev/null 2>&1 || :
update-rc.d -f one-context-local remove >/dev/null 2>&1 || :
fi
fi
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
#!/bin/bash
#
# chkconfig: 2345 9 99
# description: network reconfigure
#

# -------------------------------------------------------------------------- #
# Copyright 2010-2016, OpenNebula Systems #
# 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 #
Expand All @@ -20,20 +17,27 @@
#--------------------------------------------------------------------------- #

### BEGIN INIT INFO
# Provides: vmcontext
# Required-Start: $all
# Provides: one-context
# Required-Start: $local_fs $network $syslog one-context-local
# Required-Stop:
# Should-Start: networking
# Should-Stop: networking
# Should-Start: $time
# Should-Stop:
# X-Start-Before: sshd
# X-Stop-After:
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: OpenNebula contextualization script
# Short-Description: OpenNebula contextualization
### END INIT INFO

. /lib/lsb/init-functions

case "$1" in
"start")
/usr/sbin/one-contextd

start)
log_daemon_msg $"Starting OpenNebula contextualization"
/usr/sbin/one-contextd network
log_end_msg $?
;;
*)
log_action_msg $"Usage: $0 {start}"
exit 2
esac

48 changes: 48 additions & 0 deletions src/etc/init.d/one-context##rpm.sysv.one
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
#!/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: 2345 11 99
# description: OpenNebula contextualization

### BEGIN INIT INFO
# Provides: one-context
# Required-Start: $local_fs $network $syslog one-context-local
# Required-Stop:
# Should-Start: $time
# Should-Stop:
# X-Start-Before: sshd
# X-Stop-After:
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: OpenNebula contextualization
### END INIT INFO

# Source function library.
. /etc/rc.d/init.d/functions

case "$1" in
start)
action $"Starting OpenNebula contextualization: " \
/usr/sbin/one-contextd network
;;
*)
echo $"Usage: $0 {start}"
exit 2
esac

exit $?
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
#!/bin/bash
#
# chkconfig: 2345 9 99
# description: network reconfigure
#

# -------------------------------------------------------------------------- #
# Copyright 2010-2016, OpenNebula Systems #
# 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 #
Expand All @@ -20,19 +17,27 @@
#--------------------------------------------------------------------------- #

### BEGIN INIT INFO
# Provides: vmcontext
# Required-Start: $all
# Provides: one-context-local
# Required-Start: $local_fs
# Required-Stop:
# Should-Start: networking
# Should-Stop: networking
# Default-Start: 2 3 4 5
# Should-Start: $time
# Should-Stop:
# X-Start-Before: $network
# X-Stop-After:
# Default-Start: S
# Default-Stop: 0 1 6
# Short-Description: OpenNebula contextualization script
# Short-Description: OpenNebula pre-networking contextualization
### END INIT INFO

case "$1" in
"start")
/usr/sbin/one-contextd
. /lib/lsb/init-functions

case "$1" in
start)
log_daemon_msg $"Starting OpenNebula pre-networking contextualization"
/usr/sbin/one-contextd local
log_end_msg $?
;;
*)
log_action_msg $"Usage: $0 {start}"
exit 2
esac

48 changes: 48 additions & 0 deletions src/etc/init.d/one-context-local##rpm.sysv.one
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
#!/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: 2345 9 99
# description: OpenNebula pre-networking contextualization

### BEGIN INIT INFO
# Provides: one-context-local
# Required-Start: $local_fs
# Required-Stop:
# Should-Start: $time
# Should-Stop:
# X-Start-Before: $network
# X-Stop-After:
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: OpenNebula pre-networking contextualization
### END INIT INFO

# Source function library.
. /etc/rc.d/init.d/functions

case "$1" in
start)
action $"Starting OpenNebula pre-networking contextualization: " \
/usr/sbin/one-contextd local
;;
*)
echo $"Usage: $0 {start}"
exit 2
esac

exit $?
44 changes: 44 additions & 0 deletions src/etc/init.d/one-context-reconfigure##deb.sysv.one
Original file line number Diff line number Diff line change
@@ -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-reconfigure
# 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 reconfiguration
### END INIT INFO

. /lib/lsb/init-functions

case "$1" in
start)
export TIMEOUT=0
log_daemon_msg $"Starting OpenNebula reconfiguration"
/usr/sbin/one-context-reconfigure
log_end_msg $?
;;
*)
log_action_msg $"Usage: $0 {start}"
exit 2
esac

exit $?
47 changes: 47 additions & 0 deletions src/etc/init.d/one-context-reconfigure##rpm.sysv.one
Original file line number Diff line number Diff line change
@@ -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 reconfiguration

### BEGIN INIT INFO
# Provides: one-context-reconfigure
# 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 reconfiguration
### END INIT INFO

# Source function library.
. /etc/rc.d/init.d/functions

case "$1" in
start)
export TIMEOUT=0
action $"Starting OpenNebula reconfiguration: " \
/usr/sbin/one-context-reconfigure
;;
*)
echo $"Usage: $0 {start}"
exit 2
esac

exit $?
Loading