LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   DamnSmallLinux (https://www.linuxquestions.org/questions/damnsmalllinux-42/)
-   -   There's got to be a better way to do this. (https://www.linuxquestions.org/questions/damnsmalllinux-42/theres-got-to-be-a-better-way-to-do-this-719607/)

headrift 04-16-2009 10:59 AM

There's got to be a better way to do this.
 
I'm trying to breathe some life back into my gf's machine. It's old... a Pentium 133 with 16MB of RAM. Oh, and it's a laptop. :-/

It predates USB... hell, predates MMX. But it does have a PCMCIA slot. So we got a PCMCIA USB card. That's all well. Got a USB wifi stick. That works too.

The pain comes with not knowing DSL well enough. I'm trying to rig it up so that the wifi stick connects (via WPA) automatically when she boots.

I've got a script, suid root. suid'd /etc/init.d/networking. suid'd ifconfig (need to bring up wlan0), suid'd wpa_supplicant. Installed and suid'd dhcpd. Put said script at the bottom of .xinitrc so that the whole thing runs at startup.

The problem (aside from it being really ugly) is that it won't aquire a DHCP address. Grr.

...oh, and DSL won't shut down.

Help?

******* 04-16-2009 12:01 PM

Quote:

Originally Posted by headrift (Post 3511123)
The pain comes with not knowing DSL well enough.

Setuid root scripts don't work. Making a bunch of stuff setuid root "just because" is one bad habit you need to drop. If you want to do root stuff in DSL you can use sudo.


Quote:

Originally Posted by headrift (Post 3511123)
(..) won't aquire a DHCP address (..) won't shut down.

Handle one prob at a time?

headrift 04-16-2009 12:41 PM

Quote:

Originally Posted by ******* (Post 3511185)
Setuid root scripts don't work. Making a bunch of stuff setuid root "just because" is one bad habit you need to drop.

I wouldn't call it a "habit"... just seemed like a solution to a problem. I've never actually suid root a script until now. I'm trying to make this run without user intervention. She's not going to use the machine if she has to open a terminal and run a bunch of commands just to get online. This needs to be painless on her.

If you know how to do what I'm doing without the evil suid root thing, please let me know.

salasi 04-16-2009 01:41 PM

Not directly relevant to the immediate problem, but 16M isn't a lot. If you could add some more memory, I'm sure that it would run more smoothly.

******* 04-20-2009 10:35 AM

Quote:

Originally Posted by headrift (Post 3511233)
If you know how to do what I'm doing without the evil suid root thing, please let me know.

If you run 'sudo -l' as unprivileged user in DSL it will read something like "User X may run these commands: (root) NOPASSWD: ALL". Meaning you already have the capabilities to run stuff as root. And as far as I know DSL runs networking stuff on boot in /etc/init.d with the configs from /etc/network/, so what you would need to do once is make the wireless device connect to the network w/o probs. Once the modules are loaded, the device configuration and network settings are OK and iwconfig and dhclient have run this should "just work" and without intervention.


All times are GMT -5. The time now is 02:52 AM.