1
0
mirror of https://github.com/OpenNebula/one.git synced 2024-12-22 13:33:52 +03:00

F OpenNebula/one#5178: Add logrotate to supervisor (#579)

Enforce logrotate before the start of any opennebula's supervisor
service - as is done similarly in the systemd services.

Signed-off-by: Petr Ospalý <pospaly@opennebula.io>
This commit is contained in:
Petr Ospalý 2020-12-21 18:56:40 +01:00 committed by GitHub
parent bb8e071348
commit 36e6cbe546
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 32 additions and 0 deletions

View File

@ -35,5 +35,9 @@ else
msg "File created - continue"
fi
msg "Rotate log to start with an empty one"
/usr/sbin/logrotate -s /var/lib/one/.logrotate.status \
-f /etc/logrotate.d/opennebula-fireedge
msg "Service started!"
exec /usr/bin/node /usr/lib/one/fireedge/dist/index.js

View File

@ -35,5 +35,9 @@ else
msg "File created - continue"
fi
msg "Rotate log to start with an empty one"
/usr/sbin/logrotate -s /var/lib/one/.logrotate.status \
-f /etc/logrotate.d/opennebula-flow
msg "Service started!"
exec /usr/bin/ruby /usr/lib/one/oneflow/oneflow-server.rb

View File

@ -35,5 +35,9 @@ else
msg "File created - continue"
fi
msg "Rotate log to start with an empty one"
/usr/sbin/logrotate -s /var/lib/one/.logrotate.status \
-f /etc/logrotate.d/opennebula-gate
msg "Service started!"
exec /usr/bin/ruby /usr/lib/one/onegate/onegate-server.rb

View File

@ -38,5 +38,9 @@ done
export SSH_AUTH_SOCK
msg "Rotate log to start with an empty one"
/usr/sbin/logrotate -s /var/lib/one/.logrotate.status \
-f /etc/logrotate.d/opennebula-hem
msg "Service started!"
exec /usr/bin/ruby /usr/lib/one/onehem/onehem-server.rb

View File

@ -62,6 +62,10 @@ if ! _pid=$(check_vnc) ; then
/usr/bin/novnc-server start
fi
msg "Rotate log to start with an empty one"
/usr/sbin/logrotate -s /var/lib/one/.logrotate.status \
-f /etc/logrotate.d/opennebula-novnc
# now we will stay in a loop monitoring and faking the foreground process...
while sleep 1 ; do
if ! _pid=$(check_vnc) ; then

View File

@ -35,5 +35,9 @@ else
msg "File created - continue"
fi
msg "Rotate log to start with an empty one"
/usr/sbin/logrotate -s /var/lib/one/.logrotate.status \
-f /etc/logrotate.d/opennebula-scheduler
msg "Service started!"
exec /usr/bin/mm_sched

View File

@ -35,5 +35,9 @@ else
msg "File created - continue"
fi
msg "Rotate log to start with an empty one"
/usr/sbin/logrotate -s /var/lib/one/.logrotate.status \
-f /etc/logrotate.d/opennebula-sunstone
msg "Service started!"
exec /usr/bin/ruby /usr/lib/one/sunstone/sunstone-server.rb

View File

@ -63,5 +63,9 @@ if [ -e /var/lock/one/one ] ; then
rm -f /var/lock/one/one
fi
msg "Rotate log to start with an empty one"
/usr/sbin/logrotate -s /var/lib/one/.logrotate.status \
-f /etc/logrotate.d/opennebula
msg "Service started!"
exec /usr/bin/oned -f