Tiny Core Linux
Tiny Core Base => TCB Q&A Forum => Topic started by: LazyLarry on October 30, 2013, 01:51:37 PM
-
I have a program originally written for ubuntu that is now running on TC. There is both a shutdown and a reboot button as part of the program. These dont seem to do anything in TC. They simply call
reboot(0x01234567) and reboot(0xcdef0123).
What do i need to do go be able to support these buttons?
Thanks in advance.
-
Are shutdown/reboot executed as root?
-
If it is not an option to prepend sudo to the commands you use, then create reboot and shutdown scripts in ~/.local/bin/ that will add the needed sudo, eg. for reboot:
#!/bin/sh
exec sudo reboot
-
Tested, those system calls work fine on TC when run as root.
-
OK, thanks for the feedback. I don't seem to be able to run the program from the command line. I can run it from the fluff browser, but when I go to the directory and type the filename I get a "not found" error. I have just copied this program into RAM from an external drive. Do I need to do something to TC to tell it there's a new program?
ALso, to run it as root, do I just stick sudo in front of the filename or do i need to do more.
Thanks,
-
What do you mean "copied this program into RAM"?
Unless the program is in one of the directories in $PATH, you will need to provide a proper full or relative path to the executable.
Is it executable?
You can run 'hash -r' to refresh your program hash.
-
By copying into RAM i mean I have the executable on an external drive. I copy it into the /opt directory, which I assume is in RAM.
i actually can run it now, by specifying the full path. thanks for that tip. I thought If i was in the directory ( cd /opt) i could run it from the filename. I hadnt thought of using the full path.
However, I'm back to my original problem. I type "sudo /opt/filename" and the program runs, but my shutdown button only closes the app but doesn't do shutdown.
If it's any help, in the terminal window, when the program exits i get a message
init: must be run as PID 1
-
/opt is not in PATH
try
echo $PATH
Perhaps best to read the wiki on making Extensions, then create an extension which installs your app into /usr/local/bin
You might want to create a menu item also. For this follow working desktop entry examples in /tmp/tcloop
good luck
though I'm not sure why you would reinvent the wheel when these features already exist
-
Hi LazyLarry
... but when I go to the directory and type the filename I get a "not found" error.
If you are in the directory, you can execute the filename like this:
./FILENAME ... when the program exits i get a message init: must be run as PID 1
That sounds like you are not running as root. Did you try running it with sudo ?
-
yes, i tried it as sudo, but no joy either