Tiny Core Linux
Tiny Core Base => TCB Q&A Forum => Topic started by: GNUser on July 31, 2024, 12:17:34 PM
-
I run TCL15 x86_64 on my home's wireless router. It is CLI-only, so it does not have a ~/.X.d directory.
Startup jobs in /opt/bootlocal.sh run as root. Is there an official/obvious way to run startup commands as regular user without ~/.X.d?
-
Not answering your question,
But interested…
“How on earth do you get tce (or any Linux) on a home router?”
Asking from the genuine interest to use a router as “cheap server” for home automation system.
(It now runs on a 500MHz i386 1 W cpu).
-
My home wireless router is a repurposed ThinkPad X200 laptop powered by TCL, hostapd.tcz, dnsmasq.tcz, and an Alfa AWUS036ACHM USB adapter. It also functions as a media server (minidlna.tcz) and web server (nginx.tcz), among other things.
Needless to say, this machine is one of my favorite toys :)
-
Ah,
Makes sense.
I was directly googling to find out how such could be done.
I have 2 old unused linksys routers somewhere collecting dust.
But so far I found “only very limited and dedicated Linux versions could be loaded”.
So.. indeed… makes sense… your not running it on a linksys.
Very understandable a fun toy!
-
Note, on your original question,
Can you not run all commands inside boorlocal.sh as
sudo -u userX
In other words….
Bootlocal.sh will still run as root
But all commands inside as userX
-
Hi Stefann. Yes, putting this:
sudo -u bruno some_command...in /opt/bootlocal.sh works as intended. Thanks for helping me with my brain freeze :)
-
.X.d runs on every login; the cli equivalent would be ~/.profile. For things that should run only once, the way you found, su/sudo in bootlocal works.
-
Ah,
Makes sense.
I was directly googling to find out how such could be done.
I have 2 old unused linksys routers somewhere collecting dust.
But so far I found “only very limited and dedicated Linux versions could be loaded”.
So.. indeed… makes sense… your not running it on a linksys.
Very understandable a fun toy!
Depending upon the exact models and specs of your old linksys routers, you may be able to flash them with ddwrt or openwrt. Nice to try it first with old/junk hardware - starting with zero experience in such things, I managed to brick a fairly nice linksys router (that I had picked up in the clearance aisle at Walmart) on my first try with ddwrt but then had great success with openwrt on a Belkin/Linksys router (also on clearance at Walmart - I wish I'd picked up a handful of those). All of my actual junk/retired/spare routers were too low spec for that project (wireless-G vintage).
Of course, -now- I want to try what GNUser just described.
@GNUser That would make a nice wiki article. ;)
-
@GNUser: The way I usually run a command as non-root is
su -c "some command" [USERID]such as
su -c "tce-load -wi mc" tc...will run tce-load as the user "tc" instead of root.
Not sure if it was answered in any way above as the conversation went from the original question and took a tangent or two :)
-
.X.d runs on every login; the cli equivalent would be ~/.profile
Thanks, curaga. That's what I was looking for.
Thanks for the alternatives, Stefann and CentralWare.
Thread is triple-solved :)
-
Continued in below link because this is going extremely off topic:
https://forum.tinycorelinux.net/index.php/topic,27188.0.html (https://forum.tinycorelinux.net/index.php/topic,27188.0.html)
-
Hi Stefann
Off topic posts have been split off and merged with your
new topic. It has been moved to here:
https://forum.tinycorelinux.net/index.php/topic,27188.0.html
-
Of course, -now- I want to try what GNUser just described.
@GNUser That would make a nice wiki article. ;)
Hi Leee. It's just a forum post and not a wiki article, but here you go:
https://forum.tinycorelinux.net/index.php/topic,27236.msg175636.html#msg175636
The script in the post creates a humble 802.11n 2.4 GHz access point. If you'd like to create something more advanced (e.g., 802.11ac 5 GHz access point) and need help, just let me know.
-
Of course, -now- I want to try what GNUser just described.
@GNUser That would make a nice wiki article. ;)
Hi Leee. It's just a forum post and not a wiki article, but here you go:
https://forum.tinycorelinux.net/index.php/topic,27236.msg175636.html#msg175636 (https://forum.tinycorelinux.net/index.php/topic,27236.msg175636.html#msg175636)
The script in the post creates a humble 802.11n 2.4 GHz access point. If you'd like to create something more advanced (e.g., 802.11ac 5 GHz access point) and need help, just let me know.
Thanks for posting that and thanks, also, for keeping tabs on this older thread.
I'm currently dreaming up some creative solutions for a problem that my internet service provider has provided, so I might just be going down that route. Although, tbh, this issue could be solved as well with an inexpensive off the shelf wifi router - but where's the fun in that?
-
Although, tbh, this issue could be solved as well with an inexpensive off the shelf wifi router - but where's the fun in that?
The real fun in rolling your own is not so much the wifi part: It's what you can do if your router runs a general-purpose distro such as TCL and you give it a static IP (or, if that's not available from your ISP, then DDNS service from noip.com or the like). Now you can run any server you need--e.g., ssh/sftp, http, xmpp--on bare metal that's 100% under your control.
With TCL you can make your router do virtually anything you want it to. (Well, with some limits. I haven't figured out how to make mine do the dishes for me.)
-
That would work if I can cut the ISP-supplied router out of the picture entirely but, as it is now, I have to call the support number every time I want to fiddle with port forwarding (the settings aren't available to the user) - and this ISP trains their customers very well to -never- call the support number.