[systemd-devel] Network.service for wifi
Hi All, I have a wireless interface that I have created a .service. But, the wlan0 interface takes a while before it shows up in the system. I would like to know how to tell to systemd to check if the wlan0 interface is available, then if its available that's the time the systemd execute ExecStart. Any idea? Regards, john ___ systemd-devel mailing list systemd-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/systemd-devel
Re: [systemd-devel] Network.service for wifi
Follow up to my previous message: The systemd need to determine if my firmware of my wifi has been loaded by the kernel. Any idea? Regards, john On Wed, Dec 5, 2012 at 3:44 PM, John Tobias john.tobias...@gmail.com wrote: Hi All, I have a wireless interface that I have created a .service. But, the wlan0 interface takes a while before it shows up in the system. I would like to know how to tell to systemd to check if the wlan0 interface is available, then if its available that's the time the systemd execute ExecStart. Any idea? Regards, john ___ systemd-devel mailing list systemd-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/systemd-devel
[systemd-devel] Supermicro X8ST3 KVM-over-IP keyboard doesn't work with the existing rule in 42-usb-hid-pm.rules
It seems that the added rules: ACTION==add, SUBSYSTEM==usb, ATTR{idVendor}==046b, ATTR{idProduct}==ff10, TEST==power/control, ATTR{power/control}=auto creates problems for people with Supermicro X8ST3 mb (and maybe other Supermicro mb's) and renders the KVM-over-IP unusable, at BIOS and GRUB the KVM works perfectly, but after that the device is unusable. Dropping the rule fixes the issue: diff --git a/rules/42-usb-hid-pm.rules b/rules/42-usb-hid-pm.rules index c9f67c7..498c6a5 100644 --- a/rules/42-usb-hid-pm.rules +++ b/rules/42-usb-hid-pm.rules @@ -12,9 +12,6 @@ ACTION==add, SUBSYSTEM==usb, ATTR{product}==QEMU USB Mouse, ATTR{serial}== ACTION==add, SUBSYSTEM==usb, ATTR{product}==QEMU USB Tablet, ATTR{serial}==42, TEST==power/control, ATTR{power/control}=auto ACTION==add, SUBSYSTEM==usb, ATTR{product}==QEMU USB Keyboard, ATTR{serial}==42, TEST==power/control, ATTR{power/control}=auto -# AMI 046b:ff10 -ACTION==add, SUBSYSTEM==usb, ATTR{idVendor}==046b, ATTR{idProduct}==ff10, TEST==power/control, ATTR{power/control}=auto - # # Catch-all for Avocent HID devices. Keyed off interface in order to only # trigger on HID class devices. Reference bug: https://bugzilla.novell.com/show_bug.cgi?id=792576 -- Robert Milasan L3 Support Engineer SUSE Linux (http://www.suse.com) email: rmila...@suse.com GPG fingerprint: B6FE F4A8 0FA3 3040 3402 6FE7 2F64 167C 1909 6D1A ___ systemd-devel mailing list systemd-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/systemd-devel
Re: [systemd-devel] Network.service for wifi
On Wed, Dec 05, 2012 at 04:36:04PM -0800, John Tobias wrote: Follow up to my previous message: The systemd need to determine if my firmware of my wifi has been loaded by the kernel. Any idea? Probably device like sys-subsystem-net-devices-wlan0.device will appear. You can use it as an ordering point. -- Tomasz TorczThere exists no separation between gods and men: xmpp: zdzich...@chrome.pl one blends softly casual into the other. ___ systemd-devel mailing list systemd-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/systemd-devel
Re: [systemd-devel] Network.service for wifi
I use this: grep -R wlan2 /etc/udev/rules.d/ /etc/udev/rules.d/70-net.rules:SUBSYSTEM==net, ACTION==add, DRIVERS==?*, ATTR{address}==00:27:19:f5:62:90, ATTR{dev_id}==0x0, ATTR{type}==1, NAME=wlan2, ENV{SYSTEMD_WANTS}=wireless@wlan2.target, GOTO=net_ok # cat /etc/systemd/system/wireless\@.target [Unit] Description=Start services for wireless device %i # cat /etc/systemd/system/karma\@.target [Unit] Description=KARMA hostapd attack suite (on %i interface) BindsTo=karma-network@%i.service Wants=karma-dhcp@%i.service karma-hostapd@%i.service StopWhenUnneeded=yes Conflicts=kismet@%i.service [Install] WantedBy=wireless@%i.target # systemctl enable karma@wlan2.target ln -s '/etc/systemd/system/karma@.target' '/etc/systemd/system/wireless@wlan2.target.wants/karma@wlan2.target' # systemctl status sys-subsystem-net-devices-wlan2.device sys-subsystem-net-devices-wlan2.device - USB2.0_WLAN Loaded: loaded Active: active (plugged) since Чт. 2012-12-06 11:44:06 EET; 2min 24s ago Device: /sys/devices/pci:00/:00:1d.7/usb1/1-3/1-3:1.0/net/wlan2 # systemctl status karma@wlan2.target karma@wlan2.target - KARMA hostapd attack suite (on wlan2 interface) Loaded: loaded (/etc/systemd/system/karma@.target; enabled) Active: active since Чт. 2012-12-06 11:44:07 EET; 2min 45s ago ___ systemd-devel mailing list systemd-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/systemd-devel
Re: [systemd-devel] Supermicro X8ST3 KVM-over-IP keyboard doesn't work with the existing rule in 42-usb-hid-pm.rules
Matthew, any idea? Remove the rule? Thanks, Kay On Thu, Dec 6, 2012 at 9:20 AM, Robert Milasan rmila...@suse.com wrote: It seems that the added rules: ACTION==add, SUBSYSTEM==usb, ATTR{idVendor}==046b, ATTR{idProduct}==ff10, TEST==power/control, ATTR{power/control}=auto creates problems for people with Supermicro X8ST3 mb (and maybe other Supermicro mb's) and renders the KVM-over-IP unusable, at BIOS and GRUB the KVM works perfectly, but after that the device is unusable. Dropping the rule fixes the issue: diff --git a/rules/42-usb-hid-pm.rules b/rules/42-usb-hid-pm.rules index c9f67c7..498c6a5 100644 --- a/rules/42-usb-hid-pm.rules +++ b/rules/42-usb-hid-pm.rules @@ -12,9 +12,6 @@ ACTION==add, SUBSYSTEM==usb, ATTR{product}==QEMU USB Mouse, ATTR{serial}== ACTION==add, SUBSYSTEM==usb, ATTR{product}==QEMU USB Tablet, ATTR{serial}==42, TEST==power/control, ATTR{power/control}=auto ACTION==add, SUBSYSTEM==usb, ATTR{product}==QEMU USB Keyboard, ATTR{serial}==42, TEST==power/control, ATTR{power/control}=auto -# AMI 046b:ff10 -ACTION==add, SUBSYSTEM==usb, ATTR{idVendor}==046b, ATTR{idProduct}==ff10, TEST==power/control, ATTR{power/control}=auto - # # Catch-all for Avocent HID devices. Keyed off interface in order to only # trigger on HID class devices. Reference bug: https://bugzilla.novell.com/show_bug.cgi?id=792576 -- Robert Milasan L3 Support Engineer SUSE Linux (http://www.suse.com) email: rmila...@suse.com GPG fingerprint: B6FE F4A8 0FA3 3040 3402 6FE7 2F64 167C 1909 6D1A ___ systemd-devel mailing list systemd-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/systemd-devel ___ systemd-devel mailing list systemd-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/systemd-devel
[systemd-devel] [PATCH] logind: some multi-seat issues
i1. Capability of making seats without framebuffer devices logind.c: The seat is now activated by any device with udev tag seat-master 71-seat.rules.in: All framebuffer devices have this tag multi-seat-x.c: if the seat does not have a framebuffer device, runs X as a proxy, adding -sharevts only if the seat has a framebuffer device, makes a special config for X (like it did before) i2. Supporting of acls on devices shared between all seats (like /dev/snd/seq) These devices have shared udev tag in addition to uaccess A user gets permitions on it when he activates a session on any seat. He/she losses the permitions when no his/her active sessions more exist 71-seat.rules.in: sets ONE_SEAT env var to Y for all devices with seat tag 73-seat-late.rules.in: inherits ONE_SEAT env from the parent device. sets shared tag to all devices with uaccess tag with neither ONE_SEAT nor ID_SEAT env logind-acl.c: changes acl on shared devices regardless to their seats logind-seat.c: when a user removes an active sessions, checks are other active sessions of this user (on other seats) exists -- src/login/71-seat.rules.in-- index f554d7f..b9921e5 100644 @@ -11,6 +11,7 @@ TAG==uaccess, SUBSYSTEM!=sound, TAG+=seat SUBSYSTEM==sound, KERNEL==card*, TAG+=seat SUBSYSTEM==input, KERNEL==input*, TAG+=seat SUBSYSTEM==graphics, KERNEL==fb[0-9]*, TAG+=seat +SUBSYSTEM==graphics, KERNEL==fb[0-9]*, TAG+=seat-master SUBSYSTEM==usb, ATTR{bDeviceClass}==09, TAG+=seat # 'Plugable' USB hub, sound, network, graphics adapter @@ -43,6 +44,8 @@ SUBSYSTEM==usb, ATTR{idVendor}==17e9, ATTR{idProduct}==401a, ATTR{product} TAG==seat, ENV{ID_PATH}==, IMPORT{builtin}=path_id TAG==seat, ENV{ID_FOR_SEAT}==, ENV{ID_PATH_TAG}!=, ENV{ID_FOR_SEAT}=$env{SUBSYSTEM}-$env{ID_PATH_TAG} +TAG==seat, ENV{ONE_SEAT}=Y + SUBSYSTEM==input, ATTR{name}==Wiebetech LLC Wiebetech, RUN+=@rootbindir@/loginctl lock-sessions LABEL=seat_end --- src/login/73-seat-late.rules.in--- index 901df75..f043fca 100644 @@ -14,4 +14,7 @@ ENV{ID_SEAT}!=, TAG+=$env{ID_SEAT} TAG==uaccess, ENV{MAJOR}!=, RUN{builtin}+=uaccess +ENV{ONE_SEAT}==, IMPORT{parent}=ONE_SEAT +TAG==uaccess, ENV{ONE_SEAT}!=Y, ENV{ID_SEAT}==, TAG+=shared + LABEL=seat_late_end src/login/logind-acl.c index cb045a9..fb4893a 100644 @@ -174,7 +174,7 @@ finish: int devnode_acl_all(struct udev *udev, const char *seat, bool flush, -bool del, uid_t old_uid, +bool del, bool del_shared, uid_t old_uid, bool add, uid_t new_uid) { struct udev_list_entry *item = NULL, *first = NULL; @@ -208,6 +208,7 @@ int devnode_acl_all(struct udev *udev, udev_list_entry_foreach(item, first) { struct udev_device *d; const char *node, *sn; +bool is_shared; d = udev_device_new_from_syspath(udev, udev_list_entry_get_name(item)); if (!d) { @@ -215,13 +216,20 @@ int devnode_acl_all(struct udev *udev, goto finish; } -sn = udev_device_get_property_value(d, ID_SEAT); -if (isempty(sn)) -sn = seat0; +// all devices with shared tag are accessible with all seats +is_shared = udev_device_has_tag(d, shared); -if (!streq(seat, sn)) { -udev_device_unref(d); -continue; +if (is_shared) { +sn = shared; +} else { +sn = udev_device_get_property_value(d, ID_SEAT); +if (isempty(sn)) +sn = seat0; + +if (!streq(seat, sn)) { +udev_device_unref(d); +continue; +} } node = udev_device_get_devnode(d); @@ -233,7 +241,7 @@ int devnode_acl_all(struct udev *udev, log_debug(Fixing up %s for seat %s..., node, sn); -r = devnode_acl(node, flush, del, old_uid, add, new_uid); +r = devnode_acl(node, flush, is_shared ? del_shared : del, old_uid, add, new_uid); udev_device_unref(d); if (r 0) src/login/logind-acl.h index ec09843..fe1183c 100644 @@ -35,7 +35,7 @@ int devnode_acl(const char *path, int devnode_acl_all(struct udev *udev, const char *seat, bool flush, -bool del, uid_t old_uid, +bool del, bool del_shared, uid_t old_uid, bool add, uid_t new_uid); #else ---
Re: [systemd-devel] Supermicro X8ST3 KVM-over-IP keyboard doesn't work with the existing rule in 42-usb-hid-pm.rules
On Thu, Dec 6, 2012 at 5:16 PM, Matthew Garrett mj...@srcf.ucam.org wrote: On Thu, Dec 06, 2012 at 05:05:17PM +0100, Kay Sievers wrote: Matthew, any idea? Remove the rule? Sure. My suspicion is that this is fine with some firmware versions, but figuring out which is going to be a pain. Probably easiest to drop it. Removed the rule now. Thanks, Kay ___ systemd-devel mailing list systemd-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/systemd-devel
[systemd-devel] [PATCH] hwdb: ids-update: close the right file handles
The script was closing *INP and *OUTP, which never actually existed. Also fix pci_vendor() opening usb.ids and immediately discarding the fh. --- hwdb/ids-update.pl | 23 +++ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/hwdb/ids-update.pl b/hwdb/ids-update.pl index 869c49b..9ab754c 100755 --- a/hwdb/ids-update.pl +++ b/hwdb/ids-update.pl @@ -34,8 +34,8 @@ sub usb_vendor { } } -close(INP); -close(OUTP); +close(IN); +close(OUT); } sub usb_classes { @@ -100,15 +100,14 @@ sub usb_classes { } } -close(INP); -close(OUTP); +close(IN); +close(OUT); } sub pci_vendor { my $vendor; my $device; -open(IN, , usb.ids); open(IN, , pci.ids); open(OUT, , 20-pci-vendor-product.hwdb); print(OUT # This file is part of systemd.\n . @@ -149,8 +148,8 @@ sub pci_vendor { } } -close(INP); -close(OUTP); +close(IN); +close(OUT); } sub pci_classes { @@ -203,8 +202,8 @@ sub pci_classes { } } -close(INP); -close(OUTP); +close(IN); +close(OUT); } sub oui { @@ -237,7 +236,7 @@ sub oui { print(OUT ID_OUI_FROM_DATABASE= . $text . \n); } } -close(INP); +close(IN); open(IN, , oui.txt); while (my $line = IN) { @@ -255,8 +254,8 @@ sub oui { } } } -close(INP); -close(OUTP); +close(IN); +close(OUT); } usb_vendor(); -- 1.8.0.1 ___ systemd-devel mailing list systemd-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/systemd-devel
Re: [systemd-devel] [PATCH] hwdb: ids-update: close the right file handles
On Thu, Dec 6, 2012 at 10:34 PM, Mantas Mikulėnas graw...@gmail.com wrote: The script was closing *INP and *OUTP, which never actually existed. Also fix pci_vendor() opening usb.ids and immediately discarding the fh. Applied. Thanks, Kay ___ systemd-devel mailing list systemd-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/systemd-devel
[systemd-devel] missing linked man pages on freedesktop.org
Hello! I have read the bootup(7) man page on http://www.freedesktop.org/software/systemd/man/bootup.html I realized, that there are at least two links, that point to non existing sites (404): - dracut(8) http://www.freedesktop.org/software/systemd/man/dracut.html - boot(7) http://www.freedesktop.org/software/systemd/man/boot.html Perhaps someone could check and fix this. Best regards, Markus ___ systemd-devel mailing list systemd-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/systemd-devel
Re: [systemd-devel] missing linked man pages on freedesktop.org
Possibe correct links: http://www.kernel.org/pub/linux/utils/boot/dracut/dracut.html#dracut8 http://www.kernel.org/doc/man-pages/online/pages/man7/boot.7.html On Dec 6, 2012 10:58 PM, Markus Rathgeb maggu2...@gmail.com wrote: Hello! I have read the bootup(7) man page on http://www.freedesktop.org/software/systemd/man/bootup.html I realized, that there are at least two links, that point to non existing sites (404): - dracut(8) http://www.freedesktop.org/software/systemd/man/dracut.html - boot(7) http://www.freedesktop.org/software/systemd/man/boot.html Perhaps someone could check and fix this. Best regards, Markus ___ systemd-devel mailing list systemd-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/systemd-devel
[systemd-devel] [PATCH] add %U for uids in units
--- man/systemd.unit.xml | 5 + src/core/unit-printf.c | 17 +++-- 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/man/systemd.unit.xml b/man/systemd.unit.xml index 35644d3..bf91b4e 100644 --- a/man/systemd.unit.xml +++ b/man/systemd.unit.xml @@ -264,6 +264,11 @@ entryThis is the name of the configured user of the unit, or (if none is set) the user running the systemd instance./entry /row row +entryliteral%U/literal/entry +entryUser uid/entry +entryThis is the uid of the configured user of the unit, or (if none is set) the user running the systemd instance./entry + /row + row entryliteral%h/literal/entry entryUser home directory/entry entryThis is the home directory of the configured user of the unit, or (if none is set) the user running the systemd instance./entry diff --git a/src/core/unit-printf.c b/src/core/unit-printf.c index a8eb60a..a58c96c 100644 --- a/src/core/unit-printf.c +++ b/src/core/unit-printf.c @@ -123,6 +123,8 @@ static char *specifier_user_name(char specifier, void *data, void *userdata) { ExecContext *c; int r; const char *username; +uid_t uid; +char *printed = NULL; assert(u); @@ -134,11 +136,21 @@ static char *specifier_user_name(char specifier, void *data, void *userdata) { /* fish username from passwd */ username = c-user; -r = get_user_creds(username, NULL, NULL, NULL, NULL); +r = get_user_creds(username, uid, NULL, NULL, NULL); if (r 0) return NULL; -return strdup(username); +switch (specifier) { +case 'U': +if (asprintf(printed, %d, uid) 0) +return NULL; +break; +case 'u': +printed = strdup(username); +break; +} + +return printed; } static char *specifier_user_home(char specifier, void *data, void *userdata) { @@ -292,6 +304,7 @@ char *unit_full_printf(Unit *u, const char *format) { { 'r', specifier_cgroup_root, NULL }, { 'R', specifier_cgroup_root, NULL }, { 't', specifier_runtime, NULL }, +{ 'U', specifier_user_name, NULL }, { 'u', specifier_user_name, NULL }, { 'h', specifier_user_home, NULL }, { 's', specifier_user_shell, NULL }, -- 1.8.0.1 ___ systemd-devel mailing list systemd-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/systemd-devel