bash script no longer working in VSIDO

PackRat

I run VSIDO on my HP2000 laptop. I only use the touchpad when I absolutely have to and normally go with a usb wireless mouse (inserting shameless plug for logitech here).

In Debian testing/sid and VSIDO I always used the following script to toggle the touchpad off/on:

#!/bin/bash
pgrep syndaemon &>/dev/null; [ $? = 0 ] && killall syndaemon &&

if [ $(synclient -l | grep TouchpadOff | awk '{print $3}') == 1 ] ; then
synclient touchpadoff=0;
else
synclient touchpadoff=1;
fi


Up until the recently, this script has always worked. I can issue the individual synclient commands in a terminal and toggle the touchpad on/off, but the script just fails without an error message. The script is executable.

My guess is that this is the result of the switch to systemd, but I can't see where the script would need to be modified to account for that.

Anyone else suddenly have issues with bash scripts no longer working?
I am tired of talk that comes to nothing.
-- Chief Joseph

...the sun, the darkness, the winds are all listening to what we have to say.
-- Geronimo

VastOne

Interesting one...

When exactly was 'up until recently?

I cannot see how systemd is related at all in simple bash or in what you have in those simple commands

You could run each line one at a time and see results no? 
VSIDO      VSIDO Change Blog    

    I dev VSIDO

PackRat

#2
With my latest clean install when VSIDO switched to systemd -- 2-3 iso builds ago?

The individual commads work just fine; so I just made some new key bindings.

The script itself no longer works. Not even for root user. No messages in the terminal when running the individual commands - the touchpad comes on/off though.

Systemd is the only real change; but like you I can't figure out why that would matter.
I am tired of talk that comes to nothing.
-- Chief Joseph

...the sun, the darkness, the winds are all listening to what we have to say.
-- Geronimo

VastOne

Change the shebang to sh. Or remove it completely....

A shot in the dark, but why not?

I am also looking at how systemd has changed kill and service commands
VSIDO      VSIDO Change Blog    

    I dev VSIDO

PackRat

No change in touchpad, but do a message now:

syndaemon: no process found

I'll try some more later - kids out of school early today; got to run.
I am tired of talk that comes to nothing.
-- Chief Joseph

...the sun, the darkness, the winds are all listening to what we have to say.
-- Geronimo

VastOne

I am talking on #systemd now (freenode) about this....

The question asked is

"information about how you are running that?"
VSIDO      VSIDO Change Blog    

    I dev VSIDO

VastOne

Looks like a bug was reported for that error at one time

The discussion on freenode gave nothing
Quote
<VastOne> I have a user who has used the following for years that worked before the switch to systemd
<VastOne> http://hastebin.com/siporusefe.bash
<VastOne> is there something obvious we are missing?
<thrice> information about how you are running that?
<VastOne> getting that now
<yrro> that's a weird way to write a script :)
<VastOne> :)
<thrice> looks like a classic rc.local hack :-)  ugly stuff
<VastOne> I guess the fact that it worked speaks for itself
<thrice> I hope that doesn't mean that everything that works is the right solution :-)
<VastOne> NO!
<VastOne> hehe... was being cynical and a smart ass and failing...
<VastOne> :D
<thrice> hehe
<yrro> i mean just the first line looks a bit iffy
<VastOne> I had him remove shebang and did get a message that syndaemon: no process found... so we have a lead and will address the nasty written script
<VastOne> thanks
<yrro> it's the sane as pkill syndaemon :)
<yrro> hm remove the shebang and it worked?
<yrro> or rather gave you a message?
<VastOne> no, it just gave is the message
<VastOne> us
<yrro> why on earth does that cahnge anything, yikes :)
<grawity> wwoods: what filesystem are your logs on?
<yrro> good luck anyway :)
<VastOne> thanks
VSIDO      VSIDO Change Blog    

    I dev VSIDO

PackRat

#7
Usually run that script from a terminal. I've used key binding as well.

It works if the shebang is removed; changing it to #!/bin/sh produced the message.
I am tired of talk that comes to nothing.
-- Chief Joseph

...the sun, the darkness, the winds are all listening to what we have to say.
-- Geronimo

hakerdefo

I'm not sure why your script has stopped working but in the meantime you can try the following script and see whether it toggles the touchpad on-off or not,

#!/bin/bash
synclient TouchpadOff=$(synclient -l | grep -c 'TouchpadOff.*=.*0')


Cheers!!!
You Can't Always Git What You Want

PackRat

I am tired of talk that comes to nothing.
-- Chief Joseph

...the sun, the darkness, the winds are all listening to what we have to say.
-- Geronimo