Tag Archives: systemd

systemd iptables firewall script archlinux

Hi

Here some short howto config systemd to run sysvinit firewall script:

1st copy your existing iptables script to

cp myfw /root/bin/myfw
chmod 750 /root/bin/myfw

Now lets create the systemd service as following:

vim /etc/systemd/system/myfw.service
[Unit]
Description=myfw
After=network.target

[Service]
RemainAfterExit=yes
ExecStart=/root/bin/myfw start
ExecStop=/root/bin/myfw stop
User=root

[Install]
WantedBy=multi-user.target

Enable the script for autostart at boot

systemctl enable myfw.service

Start the firewall

systemctl start myfw.service

Have fun!

make Ubuntu server powerloss proof

Hi

Sometimes, after powerloss Ubuntu hangs on boot or asking to fix filesystem errors.
To avoid this problems simply edit following files:

Edit the file:

 /etc/default/grub
GRUB_RECORDFAIL_TIMEOUT=2

After that you have to rebuild grub configuration:

update-grub

Edit the file:

/etc/default/rcS
FSCKFIX=yes

EDIT 16.05.2018:
Ubuntu 18.04 /etc/default/rcS missing due to systemd
You have to pass a kernel parameter
https://www.freedesktop.org/software/systemd/man/systemd-fsck@.service.html

/etc/default/grub

GRUB_CMDLINE_LINUX_DEFAULT="quiet splash fsck.repair=yes"

Dont forget to run update-grub

Have fun!