Commit f3204490 authored by Rafael Monnerat's avatar Rafael Monnerat

Replace init script by slapos node boot

  It is enough to use @reboot with slapos node boot on cron for include
  approprate minimal start up.

  This can be unconventional for most distros, however it is much more
  simpler and distribution independent.
parent bc137ae9
...@@ -10,12 +10,10 @@ install: all ...@@ -10,12 +10,10 @@ install: all
cd slapos; make install cd slapos; make install
mkdir -p $(DESTDIR)/usr/bin/ mkdir -p $(DESTDIR)/usr/bin/
mkdir -p $(DESTDIR)/usr/sbin/ mkdir -p $(DESTDIR)/usr/sbin/
cp slapos-start $(DESTDIR)/usr/sbin/
cp slapos-test $(DESTDIR)/usr/sbin/ cp slapos-test $(DESTDIR)/usr/sbin/
cp slapos-re6st-setup $(DESTDIR)/usr/sbin/ cp slapos-re6st-setup $(DESTDIR)/usr/sbin/
cp slapos-tweak $(DESTDIR)/usr/sbin/ cp slapos-tweak $(DESTDIR)/usr/sbin/
cp $(DESTDIR)/opt/slapos/bin/slapos $(DESTDIR)/usr/bin/ cp $(DESTDIR)/opt/slapos/bin/slapos $(DESTDIR)/usr/bin/
# Open VPN configuration
mkdir -p $(DESTDIR)/etc/opt/slapos/ mkdir -p $(DESTDIR)/etc/opt/slapos/
clean: clean:
# cd slapos; make clean # cd slapos; make clean
...@@ -11,3 +11,6 @@ MAILTO="" ...@@ -11,3 +11,6 @@ MAILTO=""
# Run "Check/add IPs and so on" once per hour # Run "Check/add IPs and so on" once per hour
0 * * * * root /opt/slapos/bin/slapos node format >> /opt/slapos/log/slapos-node-format.log 2>&1 0 * * * * root /opt/slapos/bin/slapos node format >> /opt/slapos/log/slapos-node-format.log 2>&1
# Run "Booting" on every system start
@reboot root /opt/slapos/bin/slapos node boot >> /opt/slapos/log/slapos-node-format.log 2>&1
...@@ -89,7 +89,6 @@ cp $RPM_BUILD_DIR/slapos-node_%{unmangled_version}+%{slapversion}+%{release_numb ...@@ -89,7 +89,6 @@ cp $RPM_BUILD_DIR/slapos-node_%{unmangled_version}+%{slapversion}+%{release_numb
mkdir -p $RPM_BUILD_ROOT/etc/logrotate.d/ mkdir -p $RPM_BUILD_ROOT/etc/logrotate.d/
cp $RPM_BUILD_DIR/slapos-node_%{unmangled_version}+%{slapversion}+%{release_number}/template/slapos-node.logrotate $RPM_BUILD_ROOT/etc/logrotate.d/slapos.logrotate.conf cp $RPM_BUILD_DIR/slapos-node_%{unmangled_version}+%{slapversion}+%{release_number}/template/slapos-node.logrotate $RPM_BUILD_ROOT/etc/logrotate.d/slapos.logrotate.conf
mkdir -p $RPM_BUILD_ROOT/etc/systemd/system/ mkdir -p $RPM_BUILD_ROOT/etc/systemd/system/
cp $RPM_BUILD_DIR/slapos-node_%{unmangled_version}+%{slapversion}+%{release_number}/template/slapos-node.service %{buildroot}/etc/systemd/system/
mkdir -p $RPM_BUILD_ROOT/opt/slapos/log mkdir -p $RPM_BUILD_ROOT/opt/slapos/log
%files %files
...@@ -106,10 +105,6 @@ fi ...@@ -106,10 +105,6 @@ fi
%post %post
echo """To generate slapos configuration run '#slapos node register'""" echo """To generate slapos configuration run '#slapos node register'"""
if [ -f /bin/systemctl ]; then
systemctl enable slapos-node.service
systemctl start slapos-node.service
fi
%preun %preun
if [ -f /etc/openvpn/vifib.conf ]; then if [ -f /etc/openvpn/vifib.conf ]; then
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment