mirror of
https://github.com/ntop/n2n.git
synced 2024-10-18 23:52:50 +05:30
Config files are installed with the .sample extension
You can now do 'cp edge.conf.sample edge.conf' to create a n2n configuration. If the .conf (for edge and supernode) are present, the service is enabled automatically. This prevents unwanted services to be enabled, and it preserves services activation across updates
This commit is contained in:
parent
06f29cbc5e
commit
61887c740d
@ -1,2 +1,2 @@
|
|||||||
/etc/n2n/edge.conf
|
/etc/n2n/edge.conf.sample
|
||||||
/etc/n2n/supernode.conf
|
/etc/n2n/supernode.conf.sample
|
||||||
|
@ -11,4 +11,3 @@ dh_link
|
|||||||
dh_gencontrol
|
dh_gencontrol
|
||||||
dh_md5sums
|
dh_md5sums
|
||||||
dh_builddeb
|
dh_builddeb
|
||||||
dh_builddeb
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
# Automatically added by dh_installdebconf
|
# Automatically added by dh_installdebconf/11.1.6ubuntu2
|
||||||
if [ "$1" = purge ] && [ -e /usr/share/debconf/confmodule ]; then
|
if [ "$1" = purge ] && [ -e /usr/share/debconf/confmodule ]; then
|
||||||
. /usr/share/debconf/confmodule
|
. /usr/share/debconf/confmodule
|
||||||
db_purge
|
db_purge
|
||||||
|
@ -23,12 +23,21 @@ echo "Rebuilding ld cache..."
|
|||||||
if [ -f /.dockerenv ]; then exit 0; fi
|
if [ -f /.dockerenv ]; then exit 0; fi
|
||||||
|
|
||||||
# Start service after upgrade/install
|
# Start service after upgrade/install
|
||||||
echo "(Re)Starting n2n..."
|
|
||||||
systemctl daemon-reload
|
systemctl daemon-reload
|
||||||
systemctl reset-failed
|
systemctl reset-failed
|
||||||
|
|
||||||
# Do not start services automatically
|
# Enable edge
|
||||||
#systemctl restart edge
|
if [ -f /etc/n2n/edge.conf ]; then
|
||||||
#systemctl restart supernode
|
echo "Enabling n2n edge..."
|
||||||
|
systemctl enable edge
|
||||||
|
systemctl restart edge
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Enable supernode
|
||||||
|
if [ -f /etc/n2n/supernode.conf ]; then
|
||||||
|
echo "Enabling n2n supernode..."
|
||||||
|
systemctl enable supernode
|
||||||
|
systemctl restart supernode
|
||||||
|
fi
|
||||||
|
|
||||||
exit 0
|
exit 0
|
||||||
|
@ -48,8 +48,8 @@ rm -fr $RPM_BUILD_ROOT
|
|||||||
/usr/share/man/man8/edge.8.gz
|
/usr/share/man/man8/edge.8.gz
|
||||||
/usr/lib/systemd/system/edge.service
|
/usr/lib/systemd/system/edge.service
|
||||||
/usr/lib/systemd/system/supernode.service
|
/usr/lib/systemd/system/supernode.service
|
||||||
%config(noreplace) /etc/n2n/supernode.conf
|
%config(noreplace) /etc/n2n/supernode.conf.sample
|
||||||
%config(noreplace) /etc/n2n/edge.conf
|
%config(noreplace) /etc/n2n/edge.conf.sample
|
||||||
|
|
||||||
# Set the default attributes of all of the files specified to have an
|
# Set the default attributes of all of the files specified to have an
|
||||||
# owner and group of root and to inherit the permissions of the file
|
# owner and group of root and to inherit the permissions of the file
|
||||||
@ -71,17 +71,26 @@ rm -fr $RPM_BUILD_ROOT
|
|||||||
|
|
||||||
if [ ! -f /.dockerenv ]; then
|
if [ ! -f /.dockerenv ]; then
|
||||||
/bin/systemctl daemon-reload
|
/bin/systemctl daemon-reload
|
||||||
# Do not enable service automatically
|
if [ -f /etc/n2n/edge.conf ]; then
|
||||||
#/bin/systemctl enable edge.service
|
/bin/systemctl enable edge.service
|
||||||
#/bin/systemctl restart edge.service
|
/bin/systemctl restart edge.service
|
||||||
#/bin/systemctl enable supernode.service
|
fi
|
||||||
#/bin/systemctl restart supernode.service
|
|
||||||
|
if [ -f /etc/n2n/supernode.conf ]; then
|
||||||
|
/bin/systemctl enable supernode.service
|
||||||
|
/bin/systemctl restart supernode.service
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
%preun
|
%preun
|
||||||
if [ ! -f /.dockerenv ]; then
|
if [ ! -f /.dockerenv ]; then
|
||||||
|
if [ -f /etc/n2n/edge.conf ]; then
|
||||||
/bin/systemctl disable edge.service
|
/bin/systemctl disable edge.service
|
||||||
/bin/systemctl stop edge.service
|
/bin/systemctl stop edge.service
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ -f /etc/n2n/supernode.conf ]; then
|
||||||
/bin/systemctl disable supernode.service
|
/bin/systemctl disable supernode.service
|
||||||
/bin/systemctl stop supernode.service
|
/bin/systemctl stop supernode.service
|
||||||
fi
|
fi
|
||||||
|
fi
|
||||||
|
Loading…
Reference in New Issue
Block a user