Postfwd not starting at startup

phil at philfixit.com.au phil at philfixit.com.au
Sun Dec 22 22:14:42 UTC 2024


I ran the command when i setup postfwd but for whatever reason it didn't 
enable the service, after running it again it happily enabled it.

On 23/12/24 08:50, Ralf Mardorf via ubuntu-users wrote:
> If the provided systemd unit doesn't work, you can write your own unit
> or use another workaround based on the hints provided by
> https://github.com/postfwd/postfwd , but I guess you don't need to do
> this. What's the output of
>
> systemctl status postfwd.service
$ systemctl status postfwd
● postfwd.service - Postfix firewall daemon
      Loaded: loaded (/lib/systemd/system/postfwd.service; disabled; 
vendor preset: enabled)
      Active: active (running) since Mon 2024-12-23 06:44:17 AEDT; 2h 
4min ago
     Process: 3153 ExecStart=/usr/sbin/postfwd $ARGS --daemon --file 
$CONF --interface $INET --port $PORT --user $RUNAS --group $RUNAS 
--pidfile $PIDFILE (code=exited, status=0/SUCCESS)
    Main PID: 3154 (/usr/sbin/postf)
       Tasks: 13 (limit: 38168)
      Memory: 44.0M
         CPU: 829ms
> ?
>
> What's the content of the original package's file
> /usr/lib/systemd/system/postfwd.service ?
[Unit]
Description=Postfix firewall daemon
After=network.target
Before=postfix.service

[Service]
Environment=PIDFILE=/var/run/postfwd.pid
EnvironmentFile=-/etc/default/postfwd
ExecStart=/usr/sbin/postfwd $ARGS --daemon --file $CONF --interface 
$INET --port $PORT --user $RUNAS --group $RUNAS --pidfile $PIDFILE
ExecStop=/usr/sbin/postfwd --file $CONF --pidfile $PIDFILE --kill
ExecReload=/usr/sbin/postfwd --file $CONF --pidfile $PIDFILE --reload
Type=forking

[Install]
WantedBy=multi-user.target

> Force a reinstall, then run
Ran the command systemctl enable postfwd.service again rather than reinstall
>
> cat /usr/lib/systemd/system/postfwd.service
>
> and post the output.
>
$ cat /usr/lib/systemd/system/postfwd.service
[Unit]
Description=Postfix firewall daemon
After=network.target
Before=postfix.service

[Service]
Environment=PIDFILE=/var/run/postfwd.pid
EnvironmentFile=-/etc/default/postfwd
ExecStart=/usr/sbin/postfwd $ARGS --daemon --file $CONF --interface 
$INET --port $PORT --user $RUNAS --group $RUNAS --pidfile $PIDFILE
ExecStop=/usr/sbin/postfwd --file $CONF --pidfile $PIDFILE --kill
ExecReload=/usr/sbin/postfwd --file $CONF --pidfile $PIDFILE --reload
Type=forking

[Install]
WantedBy=multi-user.target



$ systemctl status postfwd
● postfwd.service - Postfix firewall daemon
      Loaded: loaded (/lib/systemd/system/postfwd.service; enabled; 
vendor preset: enabled)
      Active: active (running) since Mon 2024-12-23 06:44:17 AEDT; 2h 
4min ago
    Main PID: 3154 (/usr/sbin/postf)
       Tasks: 13 (limit: 38168)
      Memory: 44.0M
         CPU: 830ms

After a reboot its running
:)



More information about the ubuntu-users mailing list