• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

Linux Start-Up Script not running

Sorry to resurrect this thread, but upon examining my start up console, it is having problems again.

I have the exact code from Colt45:

FLAG=0
until [ $FLAG -eq 1 ]; do
if [ -w /sys/devices/platform/i8042/serio1/serio2/speed ];
then
echo -n 160 > /sys/devices/platform/i8042/serio1/serio2/speed
echo -n 160 > /sys/devices/platform/i8042/serio1/serio2/sensitivity
let FLAG=1
else
sleep 5
fi
done

however, the error I get is:
/etc/rc.local: 24: let: not found

Anyone have any idea as to why that is?

Thanks,
-Kevin
 
The rc.d stuff usually calls rc.local, and kinda wraps it... Try ./etc/rc2.d/S99rc.local start
See if that throws the same error, cause that's what is run

Perhaps udev (or whatever) hasn't found your mouse yet? S99 shit should run after all that though. 😕


Besides the point through, you should be able to put persistent settings for things like that in /etc/udev/rules.d/ - maybe google about that.

 
Originally posted by: n0cmonkey
You should add error and condition checking too. Not sure why those files aren't' there early enough though.

I'm not very fluent in bash scripts. Could you point me to a site that gives me an example of some code for the error and condition checking?

Colt45, thanks so much - I'll give that script a go and see if it manages to find it.

You both were keying in on what I thought was the problem - udev hadn't found the secondary mouse (These are speed settings for the trackpoint on Lenovo Laptops). I suppose I'll just see what I find after modifying the udev rules.d

I'll let ya'll know!

-Kevin
 
I'm not sure what to tell you other than udev rules can be a PITA, you'd be better off fixing up the bash script to wait for the file to exist.

And why do you keep adding to the end of /etc/modprobe.d/blacklist on every boot? By the time rc.local's run udev has done it's thing already anyway.
 
Originally posted by: Nothinman
I'm not sure what to tell you other than udev rules can be a PITA, you'd be better off fixing up the bash script to wait for the file to exist.

And why do you keep adding to the end of /etc/modprobe.d/blacklist on every boot? By the time rc.local's run udev has done it's thing already anyway.

Well I tried both the udev rules and the S99 script, neither worked (for different reasons obviously). The S99 script in particular, though, said that the directory was non-existent again.

How do you tell the script to wait for the file to exist?

As for adding to the end.... I think I laughed for a full 30 seconds when I saw that. It never ever occurred to me that I would be echoing to something that didn't reset every on boot. I checked the file - yup - there was quite a lot of all the same entry there 🙂. Man, do I feel smart right now or what!

-Kevin
 
Something like this should work; It has to be backgrounded though, otherwise it will stall out whatever else..
If the file exists it writes the values and sets the flag/exits. Otherwise it sleeps 5 seconds and tries again.

FLAG=0
until [ $FLAG -eq 1 ]; do
if [ -w /sys/devices/platform/i8042/serio1/serio2/speed ];
then
echo -n 160 > /sys/devices/platform/i8042/serio1/serio2/speed
echo -n 160 > /sys/devices/platform/i8042/serio1/serio2/sensitivity
let FLAG=1
else
sleep 5
fi
done



try that at least 🙂
 
Originally posted by: Gamingphreek
Originally posted by: n0cmonkey
You should add error and condition checking too. Not sure why those files aren't' there early enough though.

I'm not very fluent in bash scripts. Could you point me to a site that gives me an example of some code for the error and condition checking?

Colt45, thanks so much - I'll give that script a go and see if it manages to find it.

You both were keying in on what I thought was the problem - udev hadn't found the secondary mouse (These are speed settings for the trackpoint on Lenovo Laptops). I suppose I'll just see what I find after modifying the udev rules.d

I'll let ya'll know!

-Kevin

Check out colt45's example above (at brief glance it looks all right), and the if documentation in your shell's manpage.
 
Sorry to resurrect this thread, but upon examining my start up console, it is having problems again.

I have the exact code from Colt45:

FLAG=0
until [ $FLAG -eq 1 ]; do
if [ -w /sys/devices/platform/i8042/serio1/serio2/speed ];
then
echo -n 160 > /sys/devices/platform/i8042/serio1/serio2/speed
echo -n 160 > /sys/devices/platform/i8042/serio1/serio2/sensitivity
let FLAG=1
else
sleep 5
fi
done

however, the error I get is:
/etc/rc.local: 24: let: not found

Anyone have any idea as to why that is?

Thanks,
-Kevin
 
I didn't try the exact script, but modified the echos so I'm not messing with stuff I don't want to be. 😉 I also didn't try it on startup, just in a terminal.

Does this setup work on the command line for you? (it does for me, but just want to make sure)
Does it work if you drop the "let"? It should (and does on the cli for me).
 
Originally posted by: n0cmonkey
Originally posted by: Nothinman
Looks like "let" is a bash thing, Debian and Ubuntu made /bin/sh point to dash now.

That seems... Odd.

EDIT: Works in pdksh as shipped by OpenBSD. 😛

Not really, dash is lighter than bash and bash is still the default interactive shell. I've never used 'let' in any of my scripts, I didn't even realize bash had it.
 
Originally posted by: Nothinman
Not really, dash is lighter than bash and bash is still the default interactive shell. I've never used 'let' in any of my scripts, I didn't even realize bash had it.

I'll forget all about it after a couple of beers tonight.
 
n0c you had the same idea that I did - remove the 'let'. It seems to be working without the 'let' in there. Honestly, what was the point of having it in the first place (I'm no pro at bash scripts)

Thanks for the help guys!
-Kevin
 
Yeah it should be fine without it... I go random with the bashisms sometimes I guess :-/

Good to hear it's working though 🙂
 
Originally posted by: Gamingphreek
n0c you had the same idea that I did - remove the 'let'. It seems to be working without the 'let' in there. Honestly, what was the point of having it in the first place (I'm no pro at bash scripts)

Thanks for the help guys!
-Kevin

In my shell's man page it looks like it has more to do with arithmetic functions than anything else. Of course, IMO if the script is complicated enough for arithmetic, then perl or python should be used. 😛
 
Back
Top