On 21.09.2014 14:16, Sven Hartge wrote:
> On Sun, 21 Sep 2014 13:53:27 +0200 Sven Hartge <s...@svenhartge.de> wrote:
>> On Sun, 21 Sep 2014 11:44:29 +0200 Thomas Liske <tho...@fiasko-nw.net>
>> wrote:
>>> On 09/21/2014 03:42 AM, Sven Hartge wrote:
>>
>>>> I noticed needrestart seems to do nothing with systemd as PID1.
>>>
>>> needrestart should work with systemd... could you please provide the
>>> (full) output of:
>>>
>>> - needrestart -vr l
>>> - systemctl status `pidof smokeping`
>>
>> See attachments. This time there are of course different services to be
>> restarted.
> 
> I think, the regexp in line 328 is too broad and the anchor ^ does not
> work anymore because there is a "* " prepending the service name in the
> output of "systemctl status".
> 
>   if(defined($ret) && $ret =~ /^([^.]+\.service) /) {
> 
> I propose the following:
> 
>   if(defined($ret) && $ret =~ /([\w_+-]+\.service) /) {
> 
> Question is: what other characters my be in a service name?

The @, for example, to answer my own question. So the regexp should be
more like:

  if(defined($ret) && $ret =~ /([\w_+-@]+\.service) /) {

Or, using the blacklist approach (still needing to remove the first ^),
excluding the whitespace beetween the "*" and the real service name:

  if(defined($ret) && $ret =~ /([^.^\s]+\.service) /) {

Grüße,
Sven.

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to