diff --git a/createlinks b/createlinks index b0e1552..e28293c 100755 --- a/createlinks +++ b/createlinks @@ -45,7 +45,7 @@ foreach (qw( /etc/diald.conf /etc/diald.filter /etc/diald/link - /var/service/ippp/config + /usr/lib/systemd/system/ippp.service.d/50koozali.conf /etc/ppp/ioptions )) { diff --git a/root/etc/e-smith/templates/etc/rsyslog.conf/32dhcpd b/root/etc/e-smith/templates/etc/rsyslog.conf/32dhcpd index d690750..3584d6e 100644 --- a/root/etc/e-smith/templates/etc/rsyslog.conf/32dhcpd +++ b/root/etc/e-smith/templates/etc/rsyslog.conf/32dhcpd @@ -1,4 +1,3 @@ - # dhcpd :programname, isequal, "dhcpd" /var/log/dhcpd/dhcpd.log & stop diff --git a/root/etc/e-smith/templates/etc/rsyslog.conf/32ippp b/root/etc/e-smith/templates/etc/rsyslog.conf/32ippp new file mode 100644 index 0000000..c860e94 --- /dev/null +++ b/root/etc/e-smith/templates/etc/rsyslog.conf/32ippp @@ -0,0 +1,3 @@ +# ippp +:programname, isequal, "ippp" /var/log/ippp/ippp.log +& stop diff --git a/root/etc/e-smith/templates/etc/rsyslog.conf/32wan b/root/etc/e-smith/templates/etc/rsyslog.conf/32wan new file mode 100644 index 0000000..d0e5f1e --- /dev/null +++ b/root/etc/e-smith/templates/etc/rsyslog.conf/32wan @@ -0,0 +1,3 @@ +# wan +:programname, isequal, "wan" /var/log/wan/wan.log +& stop diff --git a/root/etc/e-smith/templates/usr/lib/systemd/system/ippp.service.d/50koozali.conf/20service b/root/etc/e-smith/templates/usr/lib/systemd/system/ippp.service.d/50koozali.conf/20service new file mode 100644 index 0000000..1bf9991 --- /dev/null +++ b/root/etc/e-smith/templates/usr/lib/systemd/system/ippp.service.d/50koozali.conf/20service @@ -0,0 +1,11 @@ +[Service] +Environment={ + $OUT = 'ppp_options="'; + $OUT .= "user $DialupUserAccount name $DialupUserAccount "; + # If you really want to change the options used by ipppd, then + # you can set the IpppdOptions property of the 'isdn' service. + # If you do this, you'd better know what you are doing! + $OUT .= $isdn{'IpppdOptions'} || "noauth debug -vj -vjccomp -bsdcomp -ac -pc"; + $OUT .= " noipdefault ipcp-accept-local ipcp-accept-remote"; + $OUT .= ' ipparam diald"'; +} diff --git a/root/etc/logrotate.d/ippp b/root/etc/logrotate.d/ippp new file mode 100644 index 0000000..55ab409 --- /dev/null +++ b/root/etc/logrotate.d/ippp @@ -0,0 +1,9 @@ +/var/log/ippp/ippp.log { + weekly + rotate 5 + copytruncate + compress + notifempty + missingok +} + diff --git a/root/etc/logrotate.d/wan b/root/etc/logrotate.d/wan new file mode 100644 index 0000000..f9b17ed --- /dev/null +++ b/root/etc/logrotate.d/wan @@ -0,0 +1,9 @@ +/var/log/wan/wan.log { + weekly + rotate 5 + copytruncate + compress + notifempty + missingok +} + diff --git a/root/var/service/ippp/run b/root/sbin/e-smith/systemd/ippp-pre old mode 100644 new mode 100755 similarity index 94% rename from root/var/service/ippp/run rename to root/sbin/e-smith/systemd/ippp-pre index 6c17b98..5f38a2e --- a/root/var/service/ippp/run +++ b/root/sbin/e-smith/systemd/ippp-pre @@ -11,7 +11,7 @@ # This should run before dialds are started and before any attempt # is made to reconfigure ippp interfaces differently. -config_file=./config +LocalIP=$(/sbin/e-smith/config get LocalIP|| echo "127.0.0.88") modprobe hisax # TODO should check here for failure!! @@ -55,4 +55,5 @@ ifconfig ippp0 "$LocalIP" \ # where all the traffic is to/from the local # system. i.e. our reply must go out via the # diald slip proxy. -exec ipppd ippp0 -detach -hostroute $pppopts +# will be done in main process +exit 0 diff --git a/root/service/ippp b/root/service/ippp deleted file mode 120000 index 9e9a6e1..0000000 --- a/root/service/ippp +++ /dev/null @@ -1 +0,0 @@ -/var/service/ippp \ No newline at end of file diff --git a/root/service/wan b/root/service/wan deleted file mode 120000 index dc6d192..0000000 --- a/root/service/wan +++ /dev/null @@ -1 +0,0 @@ -/var/service/wan \ No newline at end of file diff --git a/root/usr/lib/systemd/system/ippp.service b/root/usr/lib/systemd/system/ippp.service new file mode 100644 index 0000000..1672fa5 --- /dev/null +++ b/root/usr/lib/systemd/system/ippp.service @@ -0,0 +1,21 @@ +[Unit] +Description=Koozali SME Server ippp service for dialup +After=network-pre.target +After=networking.service +Requires=network.target + +[Service] +Type=simple +#this needs to be updated in a dropin file +Environment=pppopts="user sme name sme noauth debug -vj -vjccomp -bsdcomp -ac -pc noipdefault ipcp-accept-local ipcp-accept-remote ipparam diald" +ExecStartPre=-/sbin/e-smith/service-status ippp +ExecStartPre=/sbin/e-smith/systemd/ippp-pre +ExecStart=/usr/sbin/ipppd ippp0 -detach -hostroute $pppopts + +Restart=always +RestartSec=20s +SyslogIdentifier=ippp + +[Install] +WantedBy=sme-server.target + diff --git a/root/var/service/ippp/log/supervise/.gitignore b/root/usr/lib/systemd/system/ippp.service.d/.gitignore similarity index 100% rename from root/var/service/ippp/log/supervise/.gitignore rename to root/usr/lib/systemd/system/ippp.service.d/.gitignore diff --git a/root/usr/lib/systemd/system/wan.service b/root/usr/lib/systemd/system/wan.service index 1707864..cd8e1fa 100644 --- a/root/usr/lib/systemd/system/wan.service +++ b/root/usr/lib/systemd/system/wan.service @@ -1,16 +1,24 @@ [Unit] Description=WAN interface for Koozali SME Server -After=network-pre.target networking.service +After=network-pre.target +After=networking.service Before=network-online.target PartOf=networking.service [Service] -Type=oneshot +PermissionsStartOnly=true +WorkingDirectory=/var/service/wan +Type=simple ExecStartPre=/sbin/e-smith/service-status wan -ExecStart=/usr/bin/sv u /service/wan -ExecStop=/usr/bin/sv stop /service/wan -ExecReload=/usr/bin/sv t /service/wan +ExecStart=/var/service/wan/run +ExecReload=/var/service/wan/run + +#run.static will just exit, this might create an infinite loop +#unless set on-failure on-abnormal on-abort on-watchdog +Restart=on-failure +RestartSec=20s RemainAfterExit=yes +SyslogIdentifier=wan [Install] WantedBy=sme-server.target diff --git a/root/var/service/ippp/down b/root/var/service/ippp/down deleted file mode 100644 index e69de29..0000000 diff --git a/root/var/service/ippp/log/run b/root/var/service/ippp/log/run deleted file mode 100644 index 4b73328..0000000 --- a/root/var/service/ippp/log/run +++ /dev/null @@ -1,6 +0,0 @@ -#! /bin/sh - -exec \ - /usr/bin/setuidgid smelog \ - /usr/bin/multilog t s5000000 \ - /var/log/ippp diff --git a/root/var/service/ippp/supervise/.gitignore b/root/var/service/ippp/supervise/.gitignore deleted file mode 100644 index e69de29..0000000 diff --git a/root/var/service/wan/down b/root/var/service/wan/down deleted file mode 100644 index e69de29..0000000 diff --git a/root/var/service/wan/log/run b/root/var/service/wan/log/run deleted file mode 100644 index 1c2a0c5..0000000 --- a/root/var/service/wan/log/run +++ /dev/null @@ -1,7 +0,0 @@ -#! /bin/sh - -exec \ - /usr/bin/setuidgid smelog \ - /usr/bin/multilog t s5000000 \ - /var/log/wan - diff --git a/root/var/service/wan/log/supervise/.gitignore b/root/var/service/wan/log/supervise/.gitignore deleted file mode 100644 index e69de29..0000000 diff --git a/root/var/service/wan/run b/root/var/service/wan/run index a9ab7e5..4bd94be 100644 --- a/root/var/service/wan/run +++ b/root/var/service/wan/run @@ -9,4 +9,5 @@ then fi echo script run.$config not found - please report this as a bug -sleep 100 +#sleep 100 +exit 0 diff --git a/root/var/service/wan/run.DHCPEthernetAddress b/root/var/service/wan/run.DHCPEthernetAddress new file mode 100755 index 0000000..c5567d8 --- /dev/null +++ b/root/var/service/wan/run.DHCPEthernetAddress @@ -0,0 +1,31 @@ +#!/bin/sh +#---------------------------------------------------------------------- +# copyright (C) 1999-2006 Mitel Networks Corporation +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# +#---------------------------------------------------------------------- +exec 2>&1 + +. ./dhclient.config + +configfile=/var/lib/dhclient/dhclient-$interface.conf +leasefile=/var/lib/dhclient/dhclient-$interface.leases + +export PEERDNS=no +exec /sbin/dhclient -d \ + -cf $configfile \ + -lf $leasefile \ + $interface diff --git a/root/var/service/wan/run.DHCPHostname b/root/var/service/wan/run.DHCPHostname new file mode 100755 index 0000000..c5567d8 --- /dev/null +++ b/root/var/service/wan/run.DHCPHostname @@ -0,0 +1,31 @@ +#!/bin/sh +#---------------------------------------------------------------------- +# copyright (C) 1999-2006 Mitel Networks Corporation +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# +#---------------------------------------------------------------------- +exec 2>&1 + +. ./dhclient.config + +configfile=/var/lib/dhclient/dhclient-$interface.conf +leasefile=/var/lib/dhclient/dhclient-$interface.leases + +export PEERDNS=no +exec /sbin/dhclient -d \ + -cf $configfile \ + -lf $leasefile \ + $interface diff --git a/root/var/service/wan/run.dialup b/root/var/service/wan/run.dialup index 1fde700..90093b2 100644 --- a/root/var/service/wan/run.dialup +++ b/root/var/service/wan/run.dialup @@ -3,7 +3,8 @@ ISDN=$(/sbin/e-smith/config getprop isdn status) if [ "$ISDN" = "enabled" ] then - sv u /service/ippp + # Stop and then start. If the units are not running yet, they will be started. + /usr/bin/systemctl restart ippp sleep 10 # TODO check here that ISDN device is available!! fi diff --git a/root/var/service/wan/run.pppoe.conf b/root/var/service/wan/run.pppoe.conf new file mode 100644 index 0000000..ca17dda --- /dev/null +++ b/root/var/service/wan/run.pppoe.conf @@ -0,0 +1,21 @@ +#------------------------------------------------------------ +# !!DO NOT MODIFY THIS FILE!! +# +# Manual changes will be lost when this file is regenerated. +# +# Please read the developer's guide, which is available +# at http://www.contribs.org/development/ +# +# Copyright (C) 1999-2006 Mitel Networks Corporation +#------------------------------------------------------------ +/sbin/ifconfig eth1 up mtu 1500 +/sbin/modprobe ppp_generic +/sbin/modprobe ppp_async +/sbin/modprobe ppp_synctty +DEVICE=eth1 +# add pppoe module +/sbin/modprobe pppoe +PPPD_MLIMIT=100000000 + +# PPPOE_TIMEOUT should be about 4*LCP_INTERVAL +PPPOE_TIMEOUT=120 diff --git a/root/var/service/wan/supervise/.gitignore b/root/var/service/wan/supervise/.gitignore deleted file mode 100644 index e69de29..0000000 diff --git a/smeserver-base.spec b/smeserver-base.spec index 0e68828..9e43343 100644 --- a/smeserver-base.spec +++ b/smeserver-base.spec @@ -4,7 +4,7 @@ Summary: smeserver server and gateway - base module %define name smeserver-base Name: %{name} %define version 11.0.0 -%define release 29 +%define release 30 Version: %{version} Release: %{release}%{?dist} License: GPL @@ -49,10 +49,9 @@ Requires: bash-completion Requires: smeserver-runit >= 2.6.0-7 Requires: smeserver-php >= 3.0.0-22 Requires: smeserver-yum >= 2.6.0-43 -# daemontools bins in use +# daemontools bins in use : +# /var/service/wan/run.pppoe Requires: /usr/bin/softlimit -Requires: /usr/bin/setuidgid -Requires: /usr/bin/multilog Obsoletes: nss_ldap < 254 Obsoletes: cpu Obsoletes: rlinetd, e-smith-mod_ssl @@ -122,25 +121,13 @@ mkdir -p $RPM_BUILD_ROOT/etc/selinux --dir /home/e-smith/ssl.crt 'attr(0700,root,root)' \ --dir /home/e-smith/ssl.pem 'attr(0700,root,root)' \ --dir /var/service/wan 'attr(1755,root,root)' \ - --file /var/service/wan/down 'attr(0644,root,root)' \ --file /var/service/wan/run 'attr(0750,root,root)' \ --file /var/service/wan/run.dhclient 'attr(0750,root,root)' \ --file /var/service/wan/run.pppoe 'attr(0750,root,root)' \ --file /var/service/wan/run.static 'attr(0750,root,root)' \ --file /var/service/wan/run.dialup 'attr(0750,root,root)' \ --file /var/service/wan/run.disabled 'attr(0750,root,root)' \ - --dir /var/service/wan/supervise 'attr(0700,root,root)' \ - --dir /var/service/wan/log 'attr(1755,root,root)' \ - --file /var/service/wan/log/run 'attr(0750,root,root)' \ - --dir /var/service/wan/log/supervise 'attr(0700,root,root)' \ --dir /var/log/wan 'attr(2750,smelog,smelog)' \ - --dir /var/service/ippp 'attr(1755,root,root)' \ - --file /var/service/ippp/down 'attr(0644,root,root)' \ - --file /var/service/ippp/run 'attr(0750,root,root)' \ - --dir /var/service/ippp/supervise 'attr(0700,root,root)' \ - --dir /var/service/ippp/log 'attr(1755,root,root)' \ - --file /var/service/ippp/log/run 'attr(0750,root,root)' \ - --dir /var/service/ippp/log/supervise 'attr(0700,root,root)' \ --dir /var/log/ippp 'attr(2750,smelog,smelog)' \ --dir /etc/e-smith/skel/user/.ssh 'attr(0700,root,root)' \ --file /etc/sysconfig/modules/dummy.modules 'attr(0755,root,root)' \ @@ -168,6 +155,9 @@ rm -rf $RPM_BUILD_ROOT /sbin/e-smith/create-system-user smelastsys 2999 \ 'sme last system user marker' /tmp /bin/false + +exit 0 + %post LEXICONS=$(find /etc/e-smith/locale/*/etc/e-smith/web/panels/password/cgi-bin/userpassword -type f 2>/dev/null) @@ -192,6 +182,10 @@ fi %changelog +* Thu Mar 06 2025 Jean-Philippe Pialasse 11.0.0-30.sme +- systemd unit for ippp [SME: 12876] +- systemd unit for wan [SME: 12875] + * Wed Mar 05 2025 Jean-Philippe Pialasse 11.0.0-29.sme - change key type from service to configuration [SME: 11367]