[systemd-devel] [PATCH] systemctl: add commands set-default and get-default

Zbigniew Jędrzejewski-Szmek zbyszek at in.waw.pl
Thu May 30 17:54:43 PDT 2013


On Tue, May 28, 2013 at 11:05:48AM +0200, Vaclav Pavlin wrote:
> From: Václav Pavlín <vpavlin at redhat.com>
> 
> systemctl set-default NAME links the default.target to the given unit,
> get-default prints out the path to the currently set default target.
Applied, with the following tweaks:

- changed get-default to print just the unit name.
- and to iterate over all unit paths, not just the top-most one. It
  is true that the default.target link is usually in /etc, but it doesn't
  have to be, and systemd looks in more places.
- added permission for unpriviledged users to call GetDefaultTarget

Please check that I didn't mess anything up!

Zbyszek


More information about the systemd-devel mailing list