systemd: Tagging /dev/virtio-ports/* for systemd

Daniel P. Berrange berrange at redhat.com
Tue Jul 5 15:54:55 UTC 2011


On Tue, Jul 05, 2011 at 04:47:18PM +0100, Richard W.M. Jones wrote:
> [Is there a Fedora-specific systemd list?  Not that I can find.]
> 
> We'd like to request that virtio-serial devices (/dev/virtio-ports/*)
> are tagged so we can use them as systemd devices.  Dan Berrange thinks
> the right incantation is to add:
> 
> SUBSYSTEM=="virtio-ports", TAG+="systemd"
> 
> to /lib/udev/rules.d/99-systemd.rules

The goal is that we want to automagically run /usr/sbin/guestfsd
when /dev/virtio-ports/org.libguestfs.channel.0 is present. For
this I believe we need to have a '.device' unit for the virtio-port
device populated from the above udev rule, so we can in turn have a
guestfsd.service unit looking like:

[Unit]
Description=libguestfs management daemon
BindTo=dev-virtio\x2dports-org.libguestfs.channel.0.device
After=dev-virtio\x2dports-org.libguestfs.channel.0.device

[Service]
ExecStart=-/usr/sbin/guestfsd
Restart=always
RestartSec=0

[Install]
WantedBy=multi-user.target


Regards,
Daniel
-- 
|: http://berrange.com      -o-    http://www.flickr.com/photos/dberrange/ :|
|: http://libvirt.org              -o-             http://virt-manager.org :|
|: http://autobuild.org       -o-         http://search.cpan.org/~danberr/ :|
|: http://entangle-photo.org       -o-       http://live.gnome.org/gtk-vnc :|


More information about the devel mailing list