[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: way of starting a firewall script in debian 9 with kde5 and sddm

thank you very much ben, I will try this too
bests regards


Le Mardi 17 octobre 2017 14h26, Ben Caradoc-Davies <ben@transient.nz> a écrit :

On 18/10/17 01:08, Stephane L wrote:

> Hi,I have a firewall script(firewall) that I laucnh with <firewall start>Is there a way in debian 9 (with kde5 and sddm) to start this script at the boot of the linux system or at the launching of xorg or of kde5 ?

systemd units are easy to write (this is the main benefit of systemd)
and can be configured run at boot time. Here is one I wrote for
iptables+ip6tables (because I do not want changes to persist across
boots, just clean rules on boot). You will need a different Type if your
program does not exit:

$ cat /etc/iptables/iptables.service
Description=iptables rules
ExecStart=/bin/bash -c "/sbin/iptables-restore <
ExecStart=/bin/bash -c "/sbin/ip6tables-restore <
ExecStop=/sbin/iptables -F
ExecStop=/sbin/ip6tables -F

I enabled it with:

systemctl enable /etc/iptables/iptables.service

This should add the required symlink in /etc/systemd/system .

Kind regards,

Ben Caradoc-Davies <ben@transient.nz>
Transient Software Limited <http://transient.nz/>
New Zealand

Reply to: