Added files to build Debian packages
This commit is contained in:
parent
8d7562cd14
commit
bdd35af00c
8 changed files with 88 additions and 0 deletions
35
debian/postinst
vendored
Executable file
35
debian/postinst
vendored
Executable file
|
@ -0,0 +1,35 @@
|
|||
#!/bin/bash
|
||||
|
||||
PREFIX=/opt/CronosAgent
|
||||
|
||||
grep master /etc/passwd > /dev/null
|
||||
if [ "$?" == "1" ]
|
||||
then
|
||||
addgroup cronos
|
||||
adduser cronos --system --home $PREFIX --shell /bin/false --disabled-login --disabled-password
|
||||
fi
|
||||
|
||||
ps -eaf | grep root | grep systemd > /dev/null
|
||||
if [ "$?" == "0" ]
|
||||
then
|
||||
ln -s -f $PREFIX/cronosagent.service /etc/systemd/system/multi-user.target.wants/cronosagent.service
|
||||
|
||||
systemctl daemon-reload
|
||||
systemctl start systemd-modules-load
|
||||
|
||||
systemctl restart cronosagent
|
||||
else
|
||||
ln -s -f $PREFIX/cronosagent-daemon /etc/init.d/cronosagent
|
||||
|
||||
update-rc.d cronosagent defaults
|
||||
|
||||
service cronosagent restart
|
||||
|
||||
if [ -d /etc/monit/conf.d ]
|
||||
then
|
||||
ln -s -f $PREFIX/cronosagent-monit /etc/monit/conf.d/cronosagent
|
||||
service monit restart
|
||||
fi
|
||||
fi
|
||||
|
||||
exit 0
|
Loading…
Add table
Add a link
Reference in a new issue