systemd / active (exited)

classic Classic list List threaded Threaded
27 messages Options
12
Reply | Threaded
Open this post in threaded view
|

systemd / active (exited)

Helmut Schneider
Hi,

what do I have to do that systemd shows correctly if a daemon is
running or not?

helmut@h2786452:~$ sudo /etc/init.d/clamav-daemon-chroot status; echo $?
_ clamav-daemon-chroot.service - LSB: ClamAV daemon
   Loaded: loaded (/etc/init.d/clamav-daemon-chroot; bad; vendor
preset: enabled)
   Active: active (exited) since Thu 2019-08-29 12:33:49 CEST; 1h 23min
ago
     Docs: man:systemd-sysv-generator(8)

Aug 29 12:32:58 h2786452 clamav-daemon-chroot[8654]:  * Starting ClamAV
daemon...
Aug 29 12:33:49 h2786452 clamav-daemon-chroot[8654]:  * ClamAV daemon
is now up and ...!
Hint: Some lines were ellipsized, use -l to show in full.
0
helmut@h2786452:~$ pgrep clamd
helmut@h2786452:~$

Thank you!


--
ubuntu-users mailing list
[hidden email]
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
Reply | Threaded
Open this post in threaded view
|

Re: systemd / active (exited)

ubuntu-users mailing list
On Thu, 29 Aug 2019 11:58:07 -0000 (UTC), Helmut Schneider wrote:

>Hi,
>
>what do I have to do that systemd shows correctly if a daemon is
>running or not?
>
>helmut@h2786452:~$ sudo /etc/init.d/clamav-daemon-chroot status; echo
>$? _ clamav-daemon-chroot.service - LSB: ClamAV daemon
>   Loaded: loaded (/etc/init.d/clamav-daemon-chroot; bad; vendor
>preset: enabled)
>   Active: active (exited) since Thu 2019-08-29 12:33:49 CEST; 1h 23min
>ago
>     Docs: man:systemd-sysv-generator(8)
>
>Aug 29 12:32:58 h2786452 clamav-daemon-chroot[8654]:  * Starting ClamAV
>daemon...
>Aug 29 12:33:49 h2786452 clamav-daemon-chroot[8654]:  * ClamAV daemon
>is now up and ...!
>Hint: Some lines were ellipsized, use -l to show in full.
>0
>helmut@h2786452:~$ pgrep clamd
>helmut@h2786452:~$
>
>Thank you!

Start the service by a systemd unit and then check with systemctl.

"systemd-sysv-generator is a generator that creates wrapper .service
units for SysV init scripts" -
https://www.freedesktop.org/software/systemd/man/systemd-sysv-generator.html

This likely means that the unit does start the init script, not calmd.
The init script does start calmd. IOW I suspect systemd only returns
the status of the init script, not of calmd.


--
ubuntu-users mailing list
[hidden email]
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
Reply | Threaded
Open this post in threaded view
|

Re: systemd / active (exited)

ubuntu-users mailing list
On Thu, 29 Aug 2019 18:57:19 +0200, Ralf Mardorf wrote:

>On Thu, 29 Aug 2019 11:58:07 -0000 (UTC), Helmut Schneider wrote:
>>Hi,
>>
>>what do I have to do that systemd shows correctly if a daemon is
>>running or not?
>>
>>helmut@h2786452:~$ sudo /etc/init.d/clamav-daemon-chroot status; echo
>>$? _ clamav-daemon-chroot.service - LSB: ClamAV daemon
>>   Loaded: loaded (/etc/init.d/clamav-daemon-chroot; bad; vendor
>>preset: enabled)
>>   Active: active (exited) since Thu 2019-08-29 12:33:49 CEST; 1h
>> 23min
>>ago
>>     Docs: man:systemd-sysv-generator(8)
>>
>>Aug 29 12:32:58 h2786452 clamav-daemon-chroot[8654]:  * Starting
>>ClamAV daemon...
>>Aug 29 12:33:49 h2786452 clamav-daemon-chroot[8654]:  * ClamAV daemon
>>is now up and ...!
>>Hint: Some lines were ellipsized, use -l to show in full.
>>0
>>helmut@h2786452:~$ pgrep clamd
>>helmut@h2786452:~$
>>
>>Thank you!  
>
>Start the service by a systemd unit and then check with systemctl.
>
>"systemd-sysv-generator is a generator that creates wrapper .service
>units for SysV init scripts" -
>https://www.freedesktop.org/software/systemd/man/systemd-sysv-generator.html
>
>This likely means that the unit does start the init script, not calmd.
>The init script does start calmd. IOW I suspect systemd only returns
>the status of the init script, not of calmd.

Oops, "clamd" :D. It might not only return the status of the script,
but also its output, but since it's not SysV inti or upstart, there is
no monitoring of the status anymore, after the script successfully
exited.

Just a wild guess ;).


--
ubuntu-users mailing list
[hidden email]
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
Reply | Threaded
Open this post in threaded view
|

Re: systemd / active (exited)

Tom H-4
In reply to this post by Helmut Schneider
On Thu, Aug 29, 2019 at 2:01 PM Helmut Schneider <[hidden email]> wrote:

>
> what do I have to do that systemd shows correctly if a daemon is
> running or not?
>
> helmut@h2786452:~$ sudo /etc/init.d/clamav-daemon-chroot status; echo $?
> _ clamav-daemon-chroot.service - LSB: ClamAV daemon
>    Loaded: loaded (/etc/init.d/clamav-daemon-chroot; bad; vendor
> preset: enabled)
>    Active: active (exited) since Thu 2019-08-29 12:33:49 CEST; 1h 23min
> ago
>      Docs: man:systemd-sysv-generator(8)
>
> Aug 29 12:32:58 h2786452 clamav-daemon-chroot[8654]:  * Starting ClamAV
> daemon...
> Aug 29 12:33:49 h2786452 clamav-daemon-chroot[8654]:  * ClamAV daemon
> is now up and ...!
> Hint: Some lines were ellipsized, use -l to show in full.
> 0
> helmut@h2786452:~$ pgrep clamd
> helmut@h2786452:~$

"sudo service clamav-daemon-chroot status" is better than "sudo
/etc/init.d/clamav-daemon-chroot status".

Since Ubuntu's using systemd, both are handing off to and using
"systemctl status clamav-daemon-chroot".

The "Loaded" line has "bad". That means that systemd couldn't parse
something in the script.

--
ubuntu-users mailing list
[hidden email]
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
Reply | Threaded
Open this post in threaded view
|

Re: systemd / active (exited)

Helmut Schneider
In reply to this post by ubuntu-users mailing list
Ralf Mardorf via ubuntu-users wrote:

> On Thu, 29 Aug 2019 11:58:07 -0000 (UTC), Helmut Schneider wrote:
> > what do I have to do that systemd shows correctly if a daemon is
> > running or not?
[...]
> Start the service by a systemd unit and then check with systemctl.
>
> "systemd-sysv-generator is a generator that creates wrapper .service
> units for SysV init scripts" -
>
https://www.freedesktop.org/software/systemd/man/systemd-sysv-generator.html
>
> This likely means that the unit does start the init script, not calmd.
> The init script does start calmd. IOW I suspect systemd only returns
> the status of the init script, not of calmd.

systemd is a book with 7 seals for me, who ever had the idea completely
lost me. It starts with I have not idea how to use variables and start
clamd chrooted:

#! /bin/sh

### BEGIN INIT INFO
# Provides:          clamav-daemon-chroot
# Required-Start:    $remote_fs $syslog
# Should-Start:
# Required-Stop:     $remote_fs $syslog
# Should-Stop:
# Default-Start:     2 3 4 5
# Default-Stop:      0 1 6
# Short-Description: ClamAV daemon
# Description:       Clam AntiVirus userspace daemon (chroot'ed)
### END INIT INFO


# This File is managed by puppet, don't edit it by hand.
# All changes will be overwritten automatically!

TMPDIR=/tmp
PATH=/sbin:/bin:/usr/sbin:/usr/bin
AMAVISD_USER=amavis
AMAVISD_GROUP=amavis
AMAVISD_ROOT=/var/amavis
DAEMON=/usr/sbin/clamd
NAME="clamd"
DESC="ClamAV daemon"
CLAMAVCONF=/etc/clamav/clamd.conf
CLAMAVPID=$(grep -i PidFile ${CLAMAVCONF} | awk '{print $2}')
. /lib/lsb/init-functions

case "$1" in
        start)
                log_action_msg "Starting ${DESC}..."
                if (pgrep -f ${DAEMON} > /dev/null); then
                        log_failure_msg "$DESC is running"
                else
                        chroot --userspec $(id -u ${AMAVISD_USER}):$(id
-g ${AMAVISD_GROUP}) ${AMAVISD_ROOT} ${DAEMON} --config-file
${CLAMAVCONF}
                fi
                log_success_msg "${DESC} is now up and running!"
        ;;
        stop)
                log_action_msg "Stopping ${DESC}..."
                start-stop-daemon --stop --oknodo --name ${NAME}
--pidfile ${AMAVISD_ROOT}/${CLAMAVPID} --retry TERM/30/KILL/5 &&
log_success_msg "${DESC} stopped!" || log_failure_msg "Error stopping
${DESC}!"
        ;;
        restart)
                $0 stop && sleep 3
                $0 start
        ;;
        status)
                start-stop-daemon --status --name $DAEMON --pidfile
${AMAVISD_ROOT}/${CLAMAVPID}
                # start-stop-daemon returns LSB compliant exit status
codes
                ret=$?
                if [ "$ret" = 0 ]; then
                        log_success_msg "$NAME is running"
                else
                        log_failure_msg "$NAME is not running"
                        exit "$ret"
                fi
        ;;
        *)
        echo "Usage: $0 {start|stop|restart|status}"
        exit 1
esac
exit 0


--
ubuntu-users mailing list
[hidden email]
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
Reply | Threaded
Open this post in threaded view
|

Re: systemd / active (exited)

ubuntu-users mailing list
On Fri, 30 Aug 2019 08:29:09 -0000 (UTC), Helmut Schneider wrote:
>systemd is a book with 7 seals for me

Breaking each seal is not the end of the world, it's the beginning of
understanding.


--
ubuntu-users mailing list
[hidden email]
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
Reply | Threaded
Open this post in threaded view
|

Re: systemd / active (exited)

Liam Proven
On Fri, 30 Aug 2019 at 11:30, Ralf Mardorf via ubuntu-users
<[hidden email]> wrote:
>
> Breaking each seal is not the end of the world, it's the beginning of
> understanding.

Perhaps the ancients were right. Perhaps there are some things mankind
was not _meant_ to understand

Personally, I start *my* services like this:

Iä! Iä! Cthulhu fhtagn!

That is not dead which can be reniced.


--
Liam Proven - Profile: https://about.me/liamproven
Email: [hidden email] - Google Mail/Hangouts/Plus: [hidden email]
Twitter/Facebook/Flickr: lproven - Skype/LinkedIn: liamproven
UK: +44 7939-087884 - ČR (+ WhatsApp/Telegram/Signal): +420 702 829 053

--
ubuntu-users mailing list
[hidden email]
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
Reply | Threaded
Open this post in threaded view
|

Re: systemd / active (exited)

ubuntu-users mailing list
On Fri, 30 Aug 2019 11:44:03 +0200, Liam Proven wrote:

>On Fri, 30 Aug 2019 at 11:30, Ralf Mardorf via ubuntu-users
><[hidden email]> wrote:
>>
>> Breaking each seal is not the end of the world, it's the beginning of
>> understanding.  
>
>Perhaps the ancients were right. Perhaps there are some things mankind
>was not _meant_ to understand
>
>Personally, I start *my* services like this:
>
>Iä! Iä! Cthulhu fhtagn!
>
>That is not dead which can be reniced.

Cthulhu is a friend of "The Coon".

https://southparkstudios.mtvnimages.com/images/shows/south-park/clip-thumbnails/season-14/1413/south-park-s14e13c03-friends-with-enemies-16x9.jpg?quality=0.8

--
All I say is that I think it is damned unlikely that anything like a
central cosmic will, a spirit world, or an eternal survival of
personality exist. They are the most preposterous and unjustified of
all the guesses which can be made about the universe, and I am not
enough of a hairsplitter to pretend that I don't regard them as arrant
and negligible moonshine. In theory, I am an agnostic, but pending the
appearance of radical evidence I must be classed, practically and
provisionally, as an atheist. - Howard Phillips Lovecraft


--
ubuntu-users mailing list
[hidden email]
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
Reply | Threaded
Open this post in threaded view
|

Re: systemd / active (exited)

Peter Flynn

On 30/08/2019 13:10, Ralf Mardorf via ubuntu-users wrote:
> On Fri, 30 Aug 2019 11:44:03 +0200, Liam Proven wrote:
[...]
>> Perhaps the ancients were right. Perhaps there are some things
>> mankind was not _meant_ to understand.

Brexit being one of them :-)

P

--
ubuntu-users mailing list
[hidden email]
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
Reply | Threaded
Open this post in threaded view
|

Re: systemd / active (exited)

Tom H-4
In reply to this post by Helmut Schneider
On Fri, Aug 30, 2019 at 10:31 AM Helmut Schneider <[hidden email]> wrote:
>
> systemd is a book with 7 seals for me, who ever had the idea
> completely lost me. It starts with I have not idea how to use
> variables and start clamd chrooted:
>
>
#! /bin/sh
> ...
> start)
> ...
> chroot --userspec $(id -u ${AMAVISD_USER}):$(id -g
> ${AMAVISD_GROUP}) ${AMAVISD_ROOT} ${DAEMON} --config-file
> ${CLAMAVCONF}
> ...

Does running this manually

chroot --userspec amavis:amavis /var/amavis /usr/sbin/clamd
--config-file /etc/clamav/clamd.conf

work?

--
ubuntu-users mailing list
[hidden email]
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
Reply | Threaded
Open this post in threaded view
|

Re: systemd / active (exited)

ubuntu-users mailing list
In reply to this post by Peter Flynn
On Fri, 30 Aug 2019 13:48:44 +0100, Peter Flynn wrote:
>On 30/08/2019 13:10, Ralf Mardorf via ubuntu-users wrote:
>> On Fri, 30 Aug 2019 11:44:03 +0200, Liam Proven wrote:  
>[...]
>>> Perhaps the ancients were right. Perhaps there are some things
>>> mankind was not _meant_ to understand.  
>
>Brexit being one of them :-)

It's not that hard to understand the reason for something irrational
such as the Brexit. Actually it's possible to understand systemd good
enough to use it, nowadays it at least is easier to accept systemd, than
using Linux with another init system and since it's just computer
stuff, it's way easier to avoid trouble while using systemd, than
to suffer from  way older issues, such as those related to general human
survival.

If we thought out "things" we are abused to be ambivalent or to suffer
from a personality disorder, while it's normal, for "normal" humans to
consider something as "Mit Scheidung.de finden Sie Ihr Glück!" -
https://www.scheidung.de/ as normal. IOW for me it's not understandable
why being ambivalent in the first place is an issue, but doing
something stupid in the first place is considered to be rational.

If we do something wrong in the first place, we usually realize that
it is wrong after around 3 days, current psychology confirms this
(at least read the ICD or way better the DSM), we actually could
stop to continue doing it, but that is considered to be sick. In work
life, relationships and societies it's preferred to go with the flow,
even if there's no doubt that is fatally wrong. Nothing is new of what
is told by Greta Thunberg, it was already known in the seventies.
Societies have got tendencies to stay with something wrong until it's
too late and then they hype it.

However, it doesn't matter if systemd is a good or bad init system
compared to other init systems. It has got not much influence to our
computer usage. For some of us it might be an annoyance, but even then
it's nothing more than an annoyance, it's not something fatally wrong.

No joke, breaking the seals and reading the fine manual helps to
workaround annoyances. It is not comparable to the "real" issues of
live.

Joking apart, systemd is double Dutch when it is new to somebody, but
it is not a closed book, we are free to open the book.


--
ubuntu-users mailing list
[hidden email]
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
Reply | Threaded
Open this post in threaded view
|

Re: systemd / active (exited)

Gene Heskett-2
On Saturday 31 August 2019 04:45:18 Ralf Mardorf via ubuntu-users wrote:

> On Fri, 30 Aug 2019 13:48:44 +0100, Peter Flynn wrote:
> >On 30/08/2019 13:10, Ralf Mardorf via ubuntu-users wrote:
> >> On Fri, 30 Aug 2019 11:44:03 +0200, Liam Proven wrote:
> >
> >[...]
> >
> >>> Perhaps the ancients were right. Perhaps there are some things
> >>> mankind was not _meant_ to understand.
> >
> >Brexit being one of them :-)
>
> It's not that hard to understand the reason for something irrational
> such as the Brexit. Actually it's possible to understand systemd good
> enough to use it, nowadays it at least is easier to accept systemd,
> than using Linux with another init system and since it's just computer
> stuff, it's way easier to avoid trouble while using systemd, than to
> suffer from  way older issues, such as those related to general human
> survival.
>
> If we thought out "things" we are abused to be ambivalent or to suffer
> from a personality disorder, while it's normal, for "normal" humans to
> consider something as "Mit Scheidung.de finden Sie Ihr Glück!" -
> https://www.scheidung.de/ as normal. IOW for me it's not
> understandable why being ambivalent in the first place is an issue,
> but doing something stupid in the first place is considered to be
> rational.
>
> If we do something wrong in the first place, we usually realize that
> it is wrong after around 3 days, current psychology confirms this
> (at least read the ICD or way better the DSM), we actually could
> stop to continue doing it, but that is considered to be sick. In work
> life, relationships and societies it's preferred to go with the flow,
> even if there's no doubt that is fatally wrong. Nothing is new of what
> is told by Greta Thunberg, it was already known in the seventies.
> Societies have got tendencies to stay with something wrong until it's
> too late and then they hype it.
>
> However, it doesn't matter if systemd is a good or bad init system
> compared to other init systems. It has got not much influence to our
> computer usage. For some of us it might be an annoyance, but even then
> it's nothing more than an annoyance, it's not something fatally wrong.
>
> No joke, breaking the seals and reading the fine manual helps to
> workaround annoyances. It is not comparable to the "real" issues of
> live.
>
> Joking apart, systemd is double Dutch when it is new to somebody, but
> it is not a closed book, we are free to open the book.

However Ralf, finding the correct book to open seems like an endless list
of broken links. Even the man pages, those that do exist, are either way
out of date, or written in fictional swahili to me.  Where is the "pinfo
systemd" that actually places the data needed by the user at his
fingertips?

Changeing to systemd may in fact be a good idea, a decade down the log
when all the organizational bugs have finally been addressed. But right
now, I feel that the people writing the code are the only ones privy to
the secret handshake.  That is not how linux works well as a general
rules

Change for a good reason is generally good because the code will often be
made more understandable and often faster.

Change for re-organization reasons are generally preceded by a "game
plan" defining those reasons. Does it exist?  IDK. I've certainly not
seen it if it does exist.

Changes just for the hell of it needs better docs than we are getting.

Cheers, Gene Heskett
--
"There are four boxes to be used in defense of liberty:
 soap, ballot, jury, and ammo. Please use in that order."
-Ed Howdershelt (Author)
If we desire respect for the law, we must first make the law respectable.
 - Louis D. Brandeis
Genes Web page <http://geneslinuxbox.net:6309/gene>

--
ubuntu-users mailing list
[hidden email]
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
Reply | Threaded
Open this post in threaded view
|

Re: systemd / active (exited)

Gary Curtin
In reply to this post by ubuntu-users mailing list
On 31/08/2019 10:45, Ralf Mardorf via ubuntu-users wrote:
> It's not that hard to understand the reason for something irrational
> such as the Brexit

It is really simple: give control of the UK back to the UK. That is what
Brexit means.

I think we did just fine before the EU, then we joined, then within a
few years Margaret Thatcher came along and messed everything up, and it
has all been downhill since then. Well, she did negotiate a £3 billion
rebate, so that's something positive. Of course other EU members might
see it as irrational maybe because of the 10s of billions in lost
revenue that comes from the UK.

Now systemd is another matter . . .

--
ubuntu-users mailing list
[hidden email]
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
Reply | Threaded
Open this post in threaded view
|

Re: systemd / active (exited)

ubuntu-users mailing list
In reply to this post by Gene Heskett-2
On Sat, 31 Aug 2019 05:36:41 -0400, Gene Heskett wrote:
>However Ralf, finding the correct book to open seems like an endless
>list of broken links.

Documentation is another issue. Everything "obscure" nowadays is hosted
at freedesktop.org. Yes, that
https://www.freedesktop.org/wiki/Software/systemd/ mentions the f*#Q$%g
spelling, but did not accurately explain all the details is an
annoyance, it requires trail-and-error experiments.


On Sat, 31 Aug 2019 11:39:10 +0200, Gary Curtin replied OT regarding
the Brexit.

The EU is based upon a very good line of reasoning, just the
realisation is a PITA.

Leaving the EU gains nothing. We need as much powerful countries as
possible inside of the EU, to improve the realisation, hence the Brexit
is irrational.


--
ubuntu-users mailing list
[hidden email]
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
Reply | Threaded
Open this post in threaded view
|

Re: systemd / active (exited)

ubuntu-users mailing list
On Sat, 31 Aug 2019 11:59:43 +0200, Ralf Mardorf wrote:
>Documentation is another issue.
 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Not my smartest train of thought :D.

Yes, the documentation is fishy, but there at least is a partly usable
documentation available and we could workaround issues, by a little bit
of trial and error. My originally claim still stands unbroken: An
annoyance is just an annoyance, it's not Ragnarök.


--
ubuntu-users mailing list
[hidden email]
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
Reply | Threaded
Open this post in threaded view
|

Re: systemd / active (exited)

Helmut Schneider
In reply to this post by Tom H-4
Tom H wrote:

> On Fri, Aug 30, 2019 at 10:31 AM Helmut Schneider <[hidden email]>
> wrote:
> >
> > systemd is a book with 7 seals for me, who ever had the idea
> > completely lost me. It starts with I have not idea how to use
> > variables and start clamd chrooted:
> >
> >
> #! /bin/sh
> > ...
> > start)
> > ...
> > chroot --userspec $(id -u ${AMAVISD_USER}):$(id -g
> > ${AMAVISD_GROUP}) ${AMAVISD_ROOT} ${DAEMON} --config-file
> > ${CLAMAVCONF}
> > ...
>
> Does running this manually
>
> chroot --userspec amavis:amavis /var/amavis /usr/sbin/clamd
> --config-file /etc/clamav/clamd.conf
>
> work?

Yes, the whole init script runs fine but if the daemon dies for some
reason systemd still happily reports "active". I use puppet and it does
then not see a reason to restart clamd.

I have to run

sudo /etc/init.d/clamav-daemon-chroot stop

in that case.


--
ubuntu-users mailing list
[hidden email]
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
Reply | Threaded
Open this post in threaded view
|

Re: systemd / active (exited)

Colin Watson
In reply to this post by ubuntu-users mailing list
On Sat, Aug 31, 2019 at 12:15:41PM +0200, Ralf Mardorf via ubuntu-users wrote:
> Yes, the documentation is fishy, but there at least is a partly usable
> documentation available and we could workaround issues, by a little bit
> of trial and error.

I have to say, even as an initial systemd sceptic, I've found its manual
pages generally excellent: they're thorough, have many useful
cross-references, and provide clear explanations of the various concepts
they introduce.  systemd is a large enough project that it can take some
searching to find things, but I really wouldn't say that its developers
have skimped on documentation, either in terms of quality or quantity.

(Admittedly I'm well-versed on Unix userspace internals and have done
quite a bit of work around the edges of init systems, so I'm sure that
gives me a leg up.  But to the extent it's possible for me to place
myself outside that experience, I haven't generally found for example
that I need to consult systemd's source code to understand or supplement
its documentation, unlike many other projects.)

--
Colin Watson                                       [[hidden email]]

--
ubuntu-users mailing list
[hidden email]
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
Reply | Threaded
Open this post in threaded view
|

Re: systemd / active (exited)

Colin Watson
In reply to this post by Helmut Schneider
On Fri, Aug 30, 2019 at 08:29:09AM -0000, Helmut Schneider wrote:
> systemd is a book with 7 seals for me, who ever had the idea completely
> lost me. It starts with I have not idea how to use variables and start
> clamd chrooted:

The vast majority of the complexity here comes from you using systemd's
compatibility mode with SysV init scripts.  I suspect that
systemd-sysv-generator is getting a bit confused by the multiple forks
that are going to be involved in the chroot setup here, and thus loses
track of the relevant process.  (Managing to keep track of and supervise
most services started by /etc/init.d/ scripts without modifications,
going beyond what sysvinit ever did, is technically quite impressive,
but it's not without limits.)

I'd be strongly inclined to write a native systemd service file for this
instead, which would be much easier to understand and debug.  Something
like this, based on the existing clamav-daemon.service (you could even
use "systemctl edit" to extend the existing clamav-daemon.service by
adding the User, Group, and RootDirectory directives, rather than having
to add a whole replacement service):


[Unit]
Description=Clam AntiVirus userspace daemon
Documentation=man:clamd(8) man:clamd.conf(5) https://www.clamav.net/documents/
# Check for database existence
ConditionPathExistsGlob=/var/lib/clamav/main.{c[vl]d,inc}
ConditionPathExistsGlob=/var/lib/clamav/daily.{c[vl]d,inc}

[Service]
User=amavis
Group=amavis
RootDirectory=/var/amavis
ExecStart=/usr/sbin/clamd --foreground=true
# Reload the database
ExecReload=/bin/kill -USR2 $MAINPID
StandardOutput=syslog

[Install]
WantedBy=multi-user.target


(This may require some further tweaking: in particular, I'm not sure
whether you need to adjust the ConditionPathExistsGlob directives, or
whether you need to add a --config-file option somewhere, or what.  But
if you're starting from somewhere like this rather than from an init
script, then "systemctl status" output will be much more likely to make
sense, and you'll have less shell script verbiage to wade through.)

--
Colin Watson                                       [[hidden email]]

--
ubuntu-users mailing list
[hidden email]
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
Reply | Threaded
Open this post in threaded view
|

Re: systemd / active (exited)

Tom H-4
In reply to this post by Helmut Schneider
On Sat, Aug 31, 2019 at 12:35 PM Helmut Schneider <[hidden email]> wrote:

> Tom H wrote:
>>
>> Does running this manually
>>
>> chroot --userspec amavis:amavis /var/amavis /usr/sbin/clamd
>> --config-file /etc/clamav/clamd.conf
>>
>> work?
>
> Yes, the whole init script runs fine but if the daemon dies for
> some reason systemd still happily reports "active". I use puppet
> and it does then not see a reason to restart clamd.
>
> I have to run
>
> sudo /etc/init.d/clamav-daemon-chroot stop
>
> in that case.

It's probably the chroot via a sysvrc script that's confusing systemd.

You can check what systemd thinks that it's supervising with
"systemctl show -p MainPID clamav-daemon-chroot.service".

--
ubuntu-users mailing list
[hidden email]
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
Reply | Threaded
Open this post in threaded view
|

Re: systemd / active (exited)

Helmut Schneider
Tom H wrote:

> On Sat, Aug 31, 2019 at 12:35 PM Helmut Schneider <[hidden email]>
> wrote:
> > Tom H wrote:
> > >
> >> Does running this manually
> > >
> >> chroot --userspec amavis:amavis /var/amavis /usr/sbin/clamd
> >> --config-file /etc/clamav/clamd.conf
> > >
> >> work?
> >
> > Yes, the whole init script runs fine but if the daemon dies for
> > some reason systemd still happily reports "active". I use puppet
> > and it does then not see a reason to restart clamd.
> >
> > I have to run
> >
> > sudo /etc/init.d/clamav-daemon-chroot stop
> >
> > in that case.
>
> It's probably the chroot via a sysvrc script that's confusing systemd.
>
> You can check what systemd thinks that it's supervising with
> "systemctl show -p MainPID clamav-daemon-chroot.service".

helmut@h2786452:~$ sudo systemctl show -p MainPID
clamav-daemon-chroot.service
MainPID=0
helmut@h2786452:~$ pgrep clamd
3353
helmut@h2786452:~$

Any way to control MainPID?


--
ubuntu-users mailing list
[hidden email]
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
12