[systemd-devel] Restarting a systemd service with new command line options from systemctl?

Lennart Poettering lennart at poettering.net
Sat Jul 7 15:22:54 UTC 2018


On Sa, 07.07.18 09:09, Rick Beldin (rick.beldin at hpe.com) wrote:

> Hi...
> 
> I was trying to understand some systemd-udevd interactions and from source I
> could see that if systemd-udevd was started with --debug option, it would log
> additional items, for example:
> 
> 
>  786                 /*
>  787                  * We have partitions but re-reading the partition table
> did not
>  788                  * work, synthesize "change" for the disk and all partitions.
>  789                  */
>  790                 log_debug("device %s closed, synthesising 'change'",
> udev_device_get_devnode(dev));
>  791                 strscpyl(filename, sizeof(filename),
> udev_device_get_syspath(dev), "/uevent", NULL);
>  792                 write_string_file(filename, "change");
> 
> While the man page for systemd-udevd shows this option and others:
> 
>      /lib/systemd/systemd-udevd [--daemon] [--debug] [--children-max=]
> [--exec-delay=]
>                                    [--event-timeout=]
> [--resolve-names=early|late|never]
>                                    [--version] [--help]
> 
> I am puzzled as to how I would restart the daemon with anyone of these options
> without hacking on the service file or killing the existing systemd-udevd and
> starting it up manually.   I puzzled over this and tried:
> 
> # systemctl restart systemd-udevd --debug
> systemctl: unrecognized option '--debug'
> 
> Is there a more supported way of doing this with systemctl for systemd-udevd,
> perhaps in general for all systemd services?   I tend to think that there
> isn't, but thought I would I ask.

To enable debug logging, do this:

    systemctl edit systemd-udevd

Then add these lines there:

    [Service]
    Environment=SYSTEMD_LOG_LEVEL=debug

And restart udevd to make it count:

    systemctl restart systemd-udevd

Lennart

-- 
Lennart Poettering, Red Hat


More information about the systemd-devel mailing list