Bug#758093: ltspfsd: quietly fails with systemd as init system

2014-08-18 Thread Vagrant Cascadian
On 2014-08-18, Petter Reinholdtsen wrote:
> Perhaps better to use a test like [ -d /run/systemd/system ] around the
> call to systemctl to detect a running systemd, and keep using the pid
> file for non-systemd environments?

Thanks for the suggestion, committed upstream and uploaded to debian...

live well,
  vagrant


pgpkpGZF9Tnbz.pgp
Description: PGP signature


Bug#758093: [Pkg-ltsp-devel] Bug#758093: ltspfsd: quietly fails with systemd as init system

2014-08-18 Thread Petter Reinholdtsen

[Vagrant Cascadian]
> --- a/scripts/ltspfs_entry
> +++ b/scripts/ltspfs_entry
> @@ -101,14 +101,13 @@ remove_device()
>  
>  start_ltspfsd()
>  {
> -if [ ! -e /var/run/ltspfsd.pid ] && [ -z "$(pgrep ltspfsd)" ]; then
> +if [ -z "$(pgrep ltspfsd)" ]; then
>  # Make this sessions secret auth cookie for ltspfs
>  if [ ! -f /var/run/ltspfs_token ]; then
>  mcookie > /var/run/ltspfs_token
>  fi
>  # start up the ltspfsd daemon
> -/usr/bin/ltspfsd
> -echo $! >/var/run/ltspfsd.pid
> +systemctl start ltspfsd || /usr/bin/ltspfsd
>  fi
>  }

Perhaps better to use a test like [ -d /run/systemd/system ] around the
call to systemctl to detect a running systemd, and keep using the pid
file for non-systemd environments?

-- 
Happy hacking
Petter Reinholdtsen


-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org



Bug#758093: ltspfsd: quietly fails with systemd as init system

2014-08-17 Thread Vagrant Cascadian
Control: tags 758093 +patch

On 2014-08-15, Vagrant Cascadian wrote:
> On 2014-08-14, Vagrant Cascadian wrote:
>> When running systemd as the init system, ltspfsd quietly fails to start.
>> It's normally started from udev on device insertion or media change if
>> ltspfsd isn't already started.
>
> This seems relevent:
>
>   
> http://blog.fraggod.net/2012/06/16/proper-ish-way-to-start-long-running-systemd-service-on-udev-event-device-hotplug.html

Yeah, that article points out that systemd kills off processes started
From udev after a certain timeout...


With the following ltspfsd.service file:

  [Unit]
  Description=LTSP Filesystem Daemon

  [Service]
  Type=forking
  ExecStart=/usr/bin/ltspfsd


And the following patch:

From e6671110026355d77678a2eff9c8481296cb17fc Mon Sep 17 00:00:00 2001
From: Vagrant Cascadian 
Date: Sat, 16 Aug 2014 20:54:17 -0700
Subject: [PATCH] Attempt to start ltspfsd using systemd unit, also drop the
 pid check, as it failed as often as it worked.

---
 scripts/ltspfs_entry | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/scripts/ltspfs_entry b/scripts/ltspfs_entry
index 4fc0fdf..fa84c40 100644
--- a/scripts/ltspfs_entry
+++ b/scripts/ltspfs_entry
@@ -101,14 +101,13 @@ remove_device()
 
 start_ltspfsd()
 {
-if [ ! -e /var/run/ltspfsd.pid ] && [ -z "$(pgrep ltspfsd)" ]; then
+if [ -z "$(pgrep ltspfsd)" ]; then
 # Make this sessions secret auth cookie for ltspfs
 if [ ! -f /var/run/ltspfs_token ]; then
 mcookie > /var/run/ltspfs_token
 fi
 # start up the ltspfsd daemon
-/usr/bin/ltspfsd
-echo $! >/var/run/ltspfsd.pid
+systemctl start ltspfsd || /usr/bin/ltspfsd
 fi
 }
 
-- 
2.0.1


It's a little more expensive to always run pgrep, but haven't found a
simpler way to ensure that ltspfsd is actually running.

Ideally, it would at least detect if systemd was running, and then
respond accordingly, but at least this gets it working...


Could also add an init script and call "service ltspfsd start" instead,
which might work regardless of init system... ?


live well,
  vagrant


pgp2DtwU2rXMs.pgp
Description: PGP signature


Bug#758093: ltspfsd: quietly fails with systemd as init system

2014-08-15 Thread Vagrant Cascadian
On 2014-08-14, Vagrant Cascadian wrote:
> When running systemd as the init system, ltspfsd quietly fails to start.
> It's normally started from udev on device insertion or media change if
> ltspfsd isn't already started.

This seems relevent:

  
http://blog.fraggod.net/2012/06/16/proper-ish-way-to-start-long-running-systemd-service-on-udev-event-device-hotplug.html


live well,
  vagrant


pgpjM5IuHYrnq.pgp
Description: PGP signature


Bug#758093: ltspfsd: quietly fails with systemd as init system

2014-08-14 Thread Vagrant Cascadian
Package: ltspfsd
Version: 1.3-1
Justification: unusable with default init system
Severity: serious
X-Debbugs-Cc: alk...@gmail.com

When running systemd as the init system, ltspfsd quietly fails to start.
It's normally started from udev on device insertion or media change if
ltspfsd isn't already started.

Works fine if switching back to sysvinit-core... so there's something
specific to the systemd environment.


live well,
  vagrant


pgphgijF0qRBL.pgp
Description: PGP signature