Re: [systemd-devel] Howto detect a session start (and end) with systemd?

2012-06-30 Thread Stef Bon
Ok,

forget last message. I've found test-login.c, which gives all answers.

Stef

2012/6/30 Stef Bon stef...@gmail.com:
 Yes,

 thank you. It looks like a can use that. It just provides what I need.

 The monitor sd_login_monitor can provide a fd. What happens with this
 fd? Is there data readable?

 Stef

 2012/6/27 David Herrmann dh.herrm...@googlemail.com:
 Hi Stef

 On Mon, Jun 25, 2012 at 11:27 AM, Stef Bon stef...@gmail.com wrote:
 Hi,

 I'm working on a construction which creates workspaces for a user
 when he/she logs in.

 These workspaces are directories with vritual directories managed by a
 FUSE fs, with access to mountable resources like harddisks, usb
 sticks, cdroms but also network services like smb shares.

 In practice this will mean for example the creation of the maps

 Devices

 and

 Network

 in the homedir of the user, and access to local block devices is able
 when accessing Devices, and a browseable network map is created in
 Network. The first type of workspace works, but still in alpha, more
 testing is required, and currently working on the network map enabling
 the detection of smb workgroups, servers and shares on the fly.

 Mounting is done by the automounter, using for example mount.cifs for
 the smb shares, and contents is redirected to the location where the
 resource is available in the workspace by the FUSE fs.

 This construction does not depend on any gui or desktop environment,
 like KDE or Gnome, and works on filesystem level. Anyone - also when
 loging in from text console - can use this.

 Now this works already very good. I've one program (fuse-workspace)
 which watches the sessions starts and ends. I've made this work by
 adding the pam module pam_script to the relevant pam files, and make
 that module run scripts which maintain a usersessions file.
 Fuse-workspace watches that file for changes.
 This works, and I'm keeping this for a always working fallback, but
 I would like to know how to do this with systemd, since this is doing
 that also, and doing things double is never a good thing on systems
 with systemd installed.

 For example: is watching the directory /run/systemd/sessions by
 inotify a good idea? (inotify is already used).

 You can use the sd-login library. It does basically the same as you
 suggested. It watches the right directories for changes and notifies
 you. However, it also has some handy helpers to list all sessions so
 you can refresh your session-list every time the directory changes.
 See sd-login.h for more information.

 Regards
 David
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] timed events

2012-06-30 Thread Alexander E. Patrakov
2012/6/29 David Strauss da...@davidstrauss.net:
snip suggestions
 Having a timer-based service start/stop bgpd.service works fine. I
 just wanted to offer a dependency-based take.

Thanks. Both suggestions are strictly better than the paper note based
solution, and your reply does prove that nothing needs to be changed
in systemd to get the effect I want.

-- 
Alexander E. Patrakov
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] systemd numbers for Debian Sid/unstable system

2012-06-30 Thread Paul Menzel
Am Mittwoch, den 27.06.2012, 12:35 +0200 schrieb Lennart Poettering:
 On Wed, 27.06.12 12:18, Paul Menzel wrote:

[…]

 540ms chrony.service
 515ms rc.local.service
 
 The rc-local generator should be smart enough to pull this in only if it
 exists. It's a really slow service and most likely just a NOP anyway.

Right. The default file `/etc/rc.local` just contains `exit 0`. So I
masked that service file.

$ sudo systemctl mask rc.local.service

 509ms vdr.service
 487ms sysfsutils.service
 
 What is this? This stuff sounds like something that can just go away...

I was surprised too. It looks like this was installed by
`grml-debootstrap` and I removed it using the following command.

$ sudo aptitude purge --purge-unused sysfsutils

[…]

 191ms screen-cleanup.service
 
 Something for tmpfiles?

I have to look into that.

 167ms systemd-tmpfiles-setup.service
 147ms pulseaudio.service
 
 Hmm, as a system service? Meh..

Well, no. Debian still ships an init.d script which reads
`/etc/default/pulseaudio` and there system mode is disabled by default.
So I masked this one too.

$ sudo systemctl mask pulseaudio.service

[…]


Thanks,

Paul


signature.asc
Description: This is a digitally signed message part
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] [PATCH] fix incorrectly named manpage for udev service

2012-06-30 Thread Kay Sievers
On Sat, Jun 30, 2012 at 3:34 PM, Colin Guthrie gm...@colin.guthr.ie wrote:
 'Twas brillig, and Kay Sievers at 29/06/12 23:48 did gyre and gimble:
 On Fri, Jun 29, 2012 at 3:15 AM, Colin Guthrie gm...@colin.guthr.ie wrote:
 'Twas brillig, and Lennart Poettering at 27/06/12 21:38 did gyre and gimble:
 On Wed, 27.06.12 14:56, Dave Reisner (dreis...@archlinux.org) wrote:

 The service is systemd-udev.service, not systemd-udevd.service.

 Applied, thanks!

 Why isn't it called systemd-udevd.service? It would be more consistent
 with the others (systemd-logind.service, systemd-journald.service,
 systemd-localed.service etc.)

 Sound good to me to rename it to *d.

 I've done this in my tree. Quick question... which of the systemd-udev*
 units should be renamed?

 Obviously systemd-udev.service, but what about
 systemd-udev-control.socket and systemd-udev-kernel.socket which are
 really sockets relating quite strongly to the daemon so perhaps should
 follow suit?

 And finally systemd-udev-settle.service and
 systemd-udev-trigger.service. These (to me) feel like they should remain
 as they currently are.

Sure, sounds fine to rename the sockets too, and leave the rest.

Kay
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] timed events

2012-06-30 Thread Kay Sievers
On Fri, Jun 29, 2012 at 4:31 AM, Kok, Auke-jan H
auke-jan.h@intel.com wrote:
 On Fri, Jun 29, 2012 at 12:49 AM, Nathan qwerty@gmail.com wrote:

 Looking at the systemd.timer documentation it seems as though all
 the timers are relative. Is there any way to get absolute timers
 relative to real time (cron like functionality - even in a later version?).

 not currently, the timer could should be expanded but it's not that
 simple to write something like that consistently.

We do not have calendar time event at the moment, because at the time
we did all that, we missed the needed kernel pieces.  Note, that cron
needs to wake up every minute and checks if someone has changed the
wall clock, and we did not want to do that.

The proper kernel interfaces are there now for timerfd, and a
cron-like functionality can be implemented in systemd:
  
http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=99ee5315dac6211e972fa3f23bcc9a0343ff58c4

One piece that needs to be sorted out on the systemd side is the
notation how to specify the format for specific calendar events, and
for re-occuring events, and how and where to store when the last
execution happened, to allow cron + anachron + at functionality in one
and the same consistent interface. It *may* be some subset or
something inspired from rfc2445, but I don't think anybody has really
looked into it so far.

The current (not really thought out) idea is for systemd to support
all the simple cron.daily, cron.weekly, ... things and support that
with built-in timers, but leave *all* custom cron jobs and user-cron
to the original cron implementation.

Which means, that most of the usual systems will not need to install
cron/at, but have all the periodic cleanup tasks still hooked up and
functional by default.

If cron is installed, the service file would check for the existence
of a custom cron config file and would start cron only if it needs to
run.

I short: if you need cron run cron, but if you need only the usual
periodic tasks, or just calendar events and don't care about cron
configuration files, systemd should do it.

Kay
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] [PATCH 2/2] units: Rename systemd-udev.service to systemd-udevd.service

2012-06-30 Thread Dave Reisner
On Sat, Jun 30, 2012 at 03:52:38PM +0100, Colin Guthrie wrote:
 This naming convention is more inline with other systemd daemon
 unit names (systemd-logind.service, systemd-localed.service etc)
 
 The companion .socket units have also been renamed, however the
 -trigger and -settle units keep their current name as these are
 not directly related to daemon process itself.
 ---
  Makefile.am   | 18 +-
  TODO  |  2 --
  man/systemd-udevd.service.xml |  4 ++--
  units/.gitignore  |  2 +-
  units/systemd-udev-control.socket | 18 --
  units/systemd-udev-kernel.socket  | 18 --
  units/systemd-udev-settle.service.in  |  2 +-
  units/systemd-udev-trigger.service.in |  4 ++--
  units/systemd-udev.service.in | 22 --
  units/systemd-udevd-control.socket| 18 ++
  units/systemd-udevd-kernel.socket | 18 ++
  units/systemd-udevd.service.in| 22 ++
  12 files changed, 73 insertions(+), 75 deletions(-)
  delete mode 100644 units/systemd-udev-control.socket
  delete mode 100644 units/systemd-udev-kernel.socket
  delete mode 100644 units/systemd-udev.service.in
  create mode 100644 units/systemd-udevd-control.socket
  create mode 100644 units/systemd-udevd-kernel.socket
  create mode 100644 units/systemd-udevd.service.in
 
 diff --git a/Makefile.am b/Makefile.am
 index b6b148e..4375af9 100644
 --- a/Makefile.am
 +++ b/Makefile.am
 @@ -307,8 +307,8 @@ dist_systemunit_DATA = \
   units/systemd-ask-password-wall.path \
   units/systemd-ask-password-console.path \
   units/syslog.target \
 - units/systemd-udev-control.socket \
 - units/systemd-udev-kernel.socket \
 + units/systemd-udevd-control.socket \
 + units/systemd-udevd-kernel.socket \
   units/systemd-timedated-ntp.target  \
   units/system-update.target
  
 @@ -339,7 +339,7 @@ nodist_systemunit_DATA = \
   units/systemd-kexec.service \
   units/systemd-fsck@.service \
   units/systemd-fsck-root.service \
 - units/systemd-udev.service \
 + units/systemd-udevd.service \
   units/systemd-udev-trigger.service \
   units/systemd-udev-settle.service \
   units/systemd-debug-shell.service
 @@ -377,7 +377,7 @@ EXTRA_DIST += \
   units/systemd-f...@.service.in \
   units/systemd-fsck-root.service.in \
   units/u...@.service.in \
 - units/systemd-udev.service \
 + units/systemd-udevd.service \
   units/systemd-udev-trigger.service \
   units/systemd-udev-settle.service \
   units/systemd-debug-shell.service.in \
 @@ -1533,21 +1533,21 @@ CLEANFILES += \
   src/udev/udev.pc
  
  EXTRA_DIST += \
 - units/systemd-udev.service.in \
 + units/systemd-udevd.service.in \
   units/systemd-udev-trigger.service.in \
   units/systemd-udev-settle.service.in
  
  CLEANFILES += \
 - units/systemd-udev.service \
 + units/systemd-udevd.service \
   units/systemd-udev-trigger.service \
   units/systemd-udev-settle.service
  
  systemd-install-hook:
   mkdir -p $(DESTDIR)$(systemunitdir)/sockets.target.wants
 - ln -sf ../systemd-udev-control.socket 
 $(DESTDIR)$(systemunitdir)/sockets.target.wants/systemd-udev-control.socket
 - ln -sf ../systemd-udev-kernel.socket 
 $(DESTDIR)$(systemunitdir)/sockets.target.wants/systemd-udev-kernel.socket
 + ln -sf ../systemd-udevd-control.socket 
 $(DESTDIR)$(systemunitdir)/sockets.target.wants/systemd-udevd-control.socket
 + ln -sf ../systemd-udevd-kernel.socket 
 $(DESTDIR)$(systemunitdir)/sockets.target.wants/systemd-udevd-kernel.socket
   mkdir -p $(DESTDIR)$(systemunitdir)/sysinit.target.wants
 - ln -sf ../systemd-udev.service 
 $(DESTDIR)$(systemunitdir)/sysinit.target.wants/systemd-udev.service
 + ln -sf ../systemd-udevd.service 
 $(DESTDIR)$(systemunitdir)/sysinit.target.wants/systemd-udevd.service
   ln -sf ../systemd-udev-trigger.service 
 $(DESTDIR)$(systemunitdir)/sysinit.target.wants/systemd-udev-trigger.service
  
  INSTALL_DATA_HOOKS += systemd-install-hook
 diff --git a/TODO b/TODO
 index 1a7b60e..7e63e4d 100644
 --- a/TODO
 +++ b/TODO
 @@ -25,8 +25,6 @@ Bugfixes:
  
  Features:
  
 -* rename systemd-udev.service to systemd-udevd.service
 -
  * document that journal data is primarily ASCII, UTF-8 where necessary and 
 binary only where nothing else makes sense.
  
  * Document:
 diff --git a/man/systemd-udevd.service.xml b/man/systemd-udevd.service.xml
 index c290b2f..0584fdb 100644
 --- a/man/systemd-udevd.service.xml
 +++ b/man/systemd-udevd.service.xml
 @@ -24,7 +24,7 @@
/refmeta
  
refnamediv
 -refnamesystemd-udev.service/refname
 +refnamesystemd-udevd.service/refname
  refnamesystemd-udev-control.socket/refname
  refnamesystemd-udev-kernel.socket/refname

You renamed these socket files...

  

Re: [systemd-devel] [PATCH 2/2] units: Rename systemd-udev.service to systemd-udevd.service

2012-06-30 Thread Colin Guthrie
'Twas brillig, and Dave Reisner at 30/06/12 16:22 did gyre and gimble:
 --- a/man/systemd-udevd.service.xml
 +++ b/man/systemd-udevd.service.xml
 @@ -24,7 +24,7 @@
/refmeta
  
refnamediv
 -refnamesystemd-udev.service/refname
 +refnamesystemd-udevd.service/refname
  refnamesystemd-udev-control.socket/refname
  refnamesystemd-udev-kernel.socket/refname
 
 You renamed these socket files...

Gah! New patch on it's way.

Col

-- 

Colin Guthrie
gmane(at)colin.guthr.ie
http://colin.guthr.ie/

Day Job:
  Tribalogic Limited http://www.tribalogic.net/
Open Source:
  Mageia Contributor http://www.mageia.org/
  PulseAudio Hacker http://www.pulseaudio.org/
  Trac Hacker http://trac.edgewall.org/



___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


[systemd-devel] [PATCH] units: Rename systemd-udev.service to systemd-udevd.service

2012-06-30 Thread Colin Guthrie
This naming convention is more inline with other systemd daemon
unit names (systemd-logind.service, systemd-localed.service etc)

The companion .socket units have also been renamed, however the
-trigger and -settle units keep their current name as these are
not directly related to daemon process itself.
---
 Makefile.am   | 18 +-
 TODO  |  2 --
 man/systemd-udevd.service.xml | 12 ++--
 units/.gitignore  |  2 +-
 units/systemd-udev-control.socket | 18 --
 units/systemd-udev-kernel.socket  | 18 --
 units/systemd-udev-settle.service.in  |  2 +-
 units/systemd-udev-trigger.service.in |  4 ++--
 units/systemd-udev.service.in | 22 --
 units/systemd-udevd-control.socket| 18 ++
 units/systemd-udevd-kernel.socket | 18 ++
 units/systemd-udevd.service.in| 22 ++
 12 files changed, 77 insertions(+), 79 deletions(-)
 delete mode 100644 units/systemd-udev-control.socket
 delete mode 100644 units/systemd-udev-kernel.socket
 delete mode 100644 units/systemd-udev.service.in
 create mode 100644 units/systemd-udevd-control.socket
 create mode 100644 units/systemd-udevd-kernel.socket
 create mode 100644 units/systemd-udevd.service.in

diff --git a/Makefile.am b/Makefile.am
index b6b148e..4375af9 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -307,8 +307,8 @@ dist_systemunit_DATA = \
units/systemd-ask-password-wall.path \
units/systemd-ask-password-console.path \
units/syslog.target \
-   units/systemd-udev-control.socket \
-   units/systemd-udev-kernel.socket \
+   units/systemd-udevd-control.socket \
+   units/systemd-udevd-kernel.socket \
units/systemd-timedated-ntp.target  \
units/system-update.target
 
@@ -339,7 +339,7 @@ nodist_systemunit_DATA = \
units/systemd-kexec.service \
units/systemd-fsck@.service \
units/systemd-fsck-root.service \
-   units/systemd-udev.service \
+   units/systemd-udevd.service \
units/systemd-udev-trigger.service \
units/systemd-udev-settle.service \
units/systemd-debug-shell.service
@@ -377,7 +377,7 @@ EXTRA_DIST += \
units/systemd-f...@.service.in \
units/systemd-fsck-root.service.in \
units/u...@.service.in \
-   units/systemd-udev.service \
+   units/systemd-udevd.service \
units/systemd-udev-trigger.service \
units/systemd-udev-settle.service \
units/systemd-debug-shell.service.in \
@@ -1533,21 +1533,21 @@ CLEANFILES += \
src/udev/udev.pc
 
 EXTRA_DIST += \
-   units/systemd-udev.service.in \
+   units/systemd-udevd.service.in \
units/systemd-udev-trigger.service.in \
units/systemd-udev-settle.service.in
 
 CLEANFILES += \
-   units/systemd-udev.service \
+   units/systemd-udevd.service \
units/systemd-udev-trigger.service \
units/systemd-udev-settle.service
 
 systemd-install-hook:
mkdir -p $(DESTDIR)$(systemunitdir)/sockets.target.wants
-   ln -sf ../systemd-udev-control.socket 
$(DESTDIR)$(systemunitdir)/sockets.target.wants/systemd-udev-control.socket
-   ln -sf ../systemd-udev-kernel.socket 
$(DESTDIR)$(systemunitdir)/sockets.target.wants/systemd-udev-kernel.socket
+   ln -sf ../systemd-udevd-control.socket 
$(DESTDIR)$(systemunitdir)/sockets.target.wants/systemd-udevd-control.socket
+   ln -sf ../systemd-udevd-kernel.socket 
$(DESTDIR)$(systemunitdir)/sockets.target.wants/systemd-udevd-kernel.socket
mkdir -p $(DESTDIR)$(systemunitdir)/sysinit.target.wants
-   ln -sf ../systemd-udev.service 
$(DESTDIR)$(systemunitdir)/sysinit.target.wants/systemd-udev.service
+   ln -sf ../systemd-udevd.service 
$(DESTDIR)$(systemunitdir)/sysinit.target.wants/systemd-udevd.service
ln -sf ../systemd-udev-trigger.service 
$(DESTDIR)$(systemunitdir)/sysinit.target.wants/systemd-udev-trigger.service
 
 INSTALL_DATA_HOOKS += systemd-install-hook
diff --git a/TODO b/TODO
index 1a7b60e..7e63e4d 100644
--- a/TODO
+++ b/TODO
@@ -25,8 +25,6 @@ Bugfixes:
 
 Features:
 
-* rename systemd-udev.service to systemd-udevd.service
-
 * document that journal data is primarily ASCII, UTF-8 where necessary and 
binary only where nothing else makes sense.
 
 * Document:
diff --git a/man/systemd-udevd.service.xml b/man/systemd-udevd.service.xml
index c290b2f..616c8f6 100644
--- a/man/systemd-udevd.service.xml
+++ b/man/systemd-udevd.service.xml
@@ -24,17 +24,17 @@
   /refmeta
 
   refnamediv
-refnamesystemd-udev.service/refname
-refnamesystemd-udev-control.socket/refname
-refnamesystemd-udev-kernel.socket/refname
+refnamesystemd-udevd.service/refname
+refnamesystemd-udevd-control.socket/refname
+refnamesystemd-udevd-kernel.socket/refname
 refnamesystemd-udevd/refname
 refpurposeDevice 

Re: [systemd-devel] [PATCH] units: Rename systemd-udev.service to systemd-udevd.service

2012-06-30 Thread Colin Guthrie
'Twas brillig, and Colin Guthrie at 30/06/12 16:33 did gyre and gimble:
 This naming convention is more inline with other systemd daemon
 unit names (systemd-logind.service, systemd-localed.service etc)
 
 The companion .socket units have also been renamed, however the
 -trigger and -settle units keep their current name as these are
 not directly related to daemon process itself.
 ---
  Makefile.am   | 18 +-
  TODO  |  2 --
  man/systemd-udevd.service.xml | 12 ++--
  units/.gitignore  |  2 +-
  units/systemd-udev-control.socket | 18 --
  units/systemd-udev-kernel.socket  | 18 --
  units/systemd-udev-settle.service.in  |  2 +-
  units/systemd-udev-trigger.service.in |  4 ++--
  units/systemd-udev.service.in | 22 --
  units/systemd-udevd-control.socket| 18 ++
  units/systemd-udevd-kernel.socket | 18 ++
  units/systemd-udevd.service.in| 22 ++
  12 files changed, 77 insertions(+), 79 deletions(-)
  delete mode 100644 units/systemd-udev-control.socket
  delete mode 100644 units/systemd-udev-kernel.socket
  delete mode 100644 units/systemd-udev.service.in
  create mode 100644 units/systemd-udevd-control.socket
  create mode 100644 units/systemd-udevd-kernel.socket
  create mode 100644 units/systemd-udevd.service.in

Apologies, my --in-reply-to argument had a $ in it that my shell
interpreted and thus messed up threading.

Please apply the Revert patch before this one, I can resend both if
you like.

Col


-- 

Colin Guthrie
gmane(at)colin.guthr.ie
http://colin.guthr.ie/

Day Job:
  Tribalogic Limited http://www.tribalogic.net/
Open Source:
  Mageia Contributor http://www.mageia.org/
  PulseAudio Hacker http://www.pulseaudio.org/
  Trac Hacker http://trac.edgewall.org/



___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel