shlusiak / isatapd

ISATAP client for Linux
http://www.saschahlusiak.de/linux/isatap.htm
GNU General Public License v2.0
12 stars 5 forks source link

add systemd support #2

Closed zhou13 closed 11 years ago

zhou13 commented 11 years ago

systemd is very popular now. Any plan to add systemd support?

Currently, I use a very simple systemd configuration:

[Unit]
Description=ISATAP Client for Linux
After=network.target nss-lookup.target

[Service]
EnvironmentFile=/etc/conf.d/isatapd
ExecStart=/usr/sbin/isatapd ${DAEMON_OPTS} ${ISATAP_ROUTERS}

[Install]
WantedBy=multi-user.target

But it lacks some configuration. It is hard to archive it only by add a service file.

One way to solve this problem is that isatapd can read some environment variable as its default value.

shlusiak commented 11 years ago

I don't have any systemd system right now but I believe there is nothing else to be done than to create a systemd config snippet to start isatapd by default or depending on another physical interface. This may as well be done downstream by the distributions and packagers, no code change to the daemon should be neccessary. If you have a nice config for me I'd be happy to bundle it in the source package for documentation.

Am Dienstag, den 27.08.2013, 09:15 -0700 schrieb zhou13:

Systemd is very popular now. Any plan to add systemd support?


Reply to this email directly or view it on GitHub: https://github.com/shlusiak/isatapd/issues/2

zhou13 commented 11 years ago

The problem is that systemd does not support shell-like programming. So you could not write code like

[ -n "${ISATAP_LINK}" ] && DAEMON_OPTS="${DAEMON_OPTS} --link ${ISATAP_LINK}"

You can only write

ExecStart=/usr/sbin/isatapd ${ISATAP_ROUTERS}

The problem is some options' default cannot be set such as --link. There is no way to set it to auto except for not writting this option.

Hope you catch what I mean.

The code change should be: automatically uses environment variable as options' default.

shlusiak commented 11 years ago

Ah, I see. I can add 'auto' statements to parameters where it makes sense. Is there anything else I should add to ease systemd integration?

zhou13 notifications@github.com wrote:

The problem is that systemd does not support shell-like programming. So you could not write code like

[ -n "${ISATAP_LINK}" ] && DAEMON_OPTS="${DAEMON_OPTS} --link ${ISATAP_LINK}"

You can only write

ExecStart=/usr/sbin/isatapd ${ISATAP_ROUTERS}

The problem is some options' default cannot be set such as --link. There is no way to set it to auto except for not writting this option.

Hope you catch what I mean.

The code change should be: automatically uses environment variable as options' default.

— Reply to this email directly or view it on GitHub.

zhou13 commented 11 years ago

I think that's enough.

zhou13 commented 11 years ago

For tracking and information propose, here is my gentoo bug: https://bugs.gentoo.org/show_bug.cgi?id=482690

shlusiak commented 11 years ago

Current master (commit 5cacef6) adds the value 'auto' to the parameters --name, --link and --interval, which effectively ignores and uses the binary or kernel defaults. This should ease configuration file handling for you. Can you please have a look if that is enough?

zhou13 commented 11 years ago

I think so. Could you make a new release?

shlusiak commented 11 years ago

done: http://www.saschahlusiak.de/linux/isatapd-0.9.7.tar.gz please give it a test. :)

shlusiak commented 11 years ago

If you have some generic systemd configuration snippets I'll be happy to include it in the source tarball