Frederic Crozat wrote:
Le mardi 20 décembre 2011 à 20:21 +0100, Christian Boltz a écrit :
Hello,
Am Dienstag, 20. Dezember 2011 schrieb Frederic Crozat:
Le mardi 20 décembre 2011 à 16:05 +0100, Christian Boltz a écrit :
The initscript calls "aa-status", prints its output and returns the status/errorcode based on $? of aa-status. How can I do this (execute a command when checking the status) with systemd to get at least the errorcode?
You can't, through systemd. The service will be based on either it is running (for a RemainAfterExit=false type) or it was run based on its error code (for a RemainAfterExit=true type).
In other words: when I ask for the status it says "well, I started it, so it must still be active" - right?
I'm sorry, but just _assuming_ the status instead of _checking_ it sounds like a bad idea[tm]. It's even worse because we are talking about security-relevant services (AppArmor, SuSEfirewall) here - I'd prefer to get the real status instead of a "well, I started it..." ;-)
Well, either there is a daemon running and the check is working fine, either there isn't and the service isn't a "real" service. It was just faked.
If that's an issue, there's a real problem. sysvinit is about more than starting services. And from Lennart's blog posts, I always assumed that systemd shall fold in all of that aspects -- I even suspect that they want to fold in cron at some future point.
But more an issue for this thread: If systemd currently only replaces the "starting services" aspect of sysvinit, what new system does the rest? As long as this isn't cleared up, sysvinit should not be abandoned, IMNSHO.
Joachim