You are not logged in.

#1 2012-08-29 21:28:49

mcloaked
Member
From: Yorkshire, UK
Registered: 2012-02-02
Posts: 1,360

[SOLVED] Test conversion to systemd - Help with iptables status

With all the discussion around systemd and with a move for systemd to [core] soon, I thought I would convert an arch laptop from initscripts to systemd and see how it worked.

I followed the advice on the arch wiki for systemd, having already moved the systemd compatible parameters out of rc.conf a while ago. After installing systemd and systemd-arch-units, and adding init=/bin/systemd to the boot kernel line the system booted up nicely with systemd - graphical login failed as the relevant unit is not enabled at that stage - so hitting return to get a login prompt and logging as root it was quick to enable graphical.target and kdm.service, and rebooting then gave me a normal kdm login screen and then a normal login to kde.

All fine at this point. (By the way total login time was just over 30 seconds for both initscripts and systemd) - then it was necessary to check which services were running - most were running by default under systemd including postfix, dovecot, and sound worked fine with a quick check on a browser for a video feed. Networking was working fine too.

However iptables which was previously working fine under initscripts was not running - I checked that the firewall rules file was intact which is was.  Executing systemctl enable iptables.service appeared to be accepted but after executing systemctl start iptables.service and checking status again it was "exited" - the commands listed under the "start" command seemed normal and no error message appeared in the /var/log/messages file about iptables.

Can anyone suggest what is needed to get iptables working under systemd (yes I have read the wiki entries but nothing seemed to be relevant to fixing that particular issue).

Thanks in advance.

Last edited by mcloaked (2012-08-30 09:01:25)


Mike C

Offline

#2 2012-08-29 21:41:52

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,426
Website

Re: [SOLVED] Test conversion to systemd - Help with iptables status

Moving to Networking. You might want to make your thread title a little more specific...


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#3 2012-08-29 21:58:40

cfr
Member
From: Cymru
Registered: 2011-11-27
Posts: 7,178

Re: [SOLVED] Test conversion to systemd - Help with iptables status

I think what you're seeing is normal. Does it give a 0 exit status?

The service is of type "oneshot". I *think* that means that it is expected to exit.

As I understand it, iptables is a bit like ipfw. It's in the kernel and the userspace tools just provide an interface to that. So there's no daemon to run.

You can tell if it has worked correctly by

iptables --list

to check that your rules have been loaded correctly.

Note: I hope somebody will quickly correct me if I'm wrong about this because I've been assuming this is the expected behaviour on my own machine!


CLI Paste | How To Ask Questions

Arch Linux | x86_64 | GPT | EFI boot | refind | stub loader | systemd | LVM2 on LUKS
Lenovo x270 | Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz | Intel Wireless 8265/8275 | US keyboard w/ Euro | 512G NVMe INTEL SSDPEKKF512G7L

Offline

#4 2012-08-29 22:38:33

jjacky
Member
Registered: 2011-11-09
Posts: 347
Website

Re: [SOLVED] Test conversion to systemd - Help with iptables status

cfr is right, iptables doesn't have a running daemon, only loads up the rules and exits, so it's normal. In fact, systemctl should report "active (exited)"; the "active" bit meaning everything works correctly/as expected. If there had been an error, it would say "failed" (and be in red, not green)

Offline

#5 2012-08-30 08:54:44

mcloaked
Member
From: Yorkshire, UK
Registered: 2012-02-02
Posts: 1,360

Re: [SOLVED] Test conversion to systemd - Help with iptables status

cfr wrote:

I think what you're seeing is normal. Does it give a 0 exit status?

The service is of type "oneshot". I *think* that means that it is expected to exit.

As I understand it, iptables is a bit like ipfw. It's in the kernel and the userspace tools just provide an interface to that. So there's no daemon to run.

You can tell if it has worked correctly by

iptables --list

to check that your rules have been loaded correctly.

Note: I hope somebody will quickly correct me if I'm wrong about this because I've been assuming this is the expected behaviour on my own machine!

Perfectly correct - I didn't think to check iptables --list but yes all the rules are there as they should be.

It would be nice to have this documented in the wiki under systemd to help anyone else coming across the same issue.

I will mark this as solved in the topic title - thank you for replying - it was very helpful (and stopped me continuing the search for a solution by googling!)


Mike C

Offline

Board footer

Powered by FluxBB