[systemd-devel] sometimes systemd takes a very long time to restart service

JB general at itpsg.com
Tue Jan 1 17:52:38 PST 2013


Thanks!  I'll try and it may work in my case.  What's interesting is 
that in your case it sounded like rsyslog was hanging around while it 
was having problems dealing with the condition of having the network 
unavailable.  In my case, webrickd actually stops and shuts down almost 
immediately but for some reason systemd doesn't or can't figure that 
out.  Right now it is happening every single time I do:
systemctl restart webrickd.service

I timed it and like you said it sits for 3 minutes every time.   Very 
irritating.  I did have it working at one point but not consistently.  
Boot's were always quick and often restarts of just the service were 
quick.  I'm not even doing a full shutdown.  I wish I could figure out 
why it is so inconsistent.

I'll try your solution but I'm concerned it's covering up a deeper 
problem and I already have quite a bit of those.  I call these types of 
solutions "technical debt" because sooner or later you will wind up 
having to paying for it :)

JB


Reindl Harald wrote:
> Am 02.01.2013 01:27, schrieb JB:
>   
>> Hello all,
>>    I do have one more question about systemd.  Sometimes, it takes a really really long time to get a service to
>> stop or restart.  Othertimes, it doesn't.  Now, when it does take a long time I get entires in the logs such as this:
>>
>> Jan  1 16:23:42 localhost systemd[1]: webrickd.service stopping timed out (2). Killing.
>> Jan  1 16:25:12 localhost systemd[1]: webrickd.service still around after SIGKILL (2). Entering failed mode.
>> Jan  1 16:25:12 localhost systemd[1]: Unit webrickd.service entered failed state.
>>     
>
> the same happens on F17 with rsyslog if it is configured for mysqld
> on a remote host because network.service is stopped before rsyslog
> and rsyslog does not handle correctly the siutuation
>
> it took me months to find out what hangs permamently 1.5 minutes
> on production machines, my workaround is a systemd-unit which
> starts after network.service and TimeoutStopSec=1
> ________________________________
>
> cat /etc/systemd/system/rsyslog.service
> [Unit]
> Description=System Logging Service
> After=network.service
>
> [Service]
> EnvironmentFile=-/etc/sysconfig/rsyslog
> ExecStart=/sbin/rsyslogd -n $SYSLOGD_OPTIONS
> Sockets=syslog.socket
> StandardOutput=null
> Restart=always
> RestartSec=1
> TimeoutStopSec=1
>
> [Install]
> WantedBy=multi-user.target
> Alias=syslog.service
>
>
>   
> ------------------------------------------------------------------------
>
> _______________________________________________
> systemd-devel mailing list
> systemd-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/systemd-devel
>   


More information about the systemd-devel mailing list