![]() |
|
|
#12 |
|
Jul 2006
Calgary
6518 Posts |
he was suggesting you use the su command to run mprime as a normal user from the /etc/rc.local init file. its a good idea to not run stuff like mprime as root when it isn't needed.
|
|
|
|
|
|
#13 |
|
Oct 2008
n00bville
23·7·13 Posts |
I don't run it as root as you can see under 'su $user -c ...'. The /etc/rc.local isn't LSB standard conform and can be found on SuSE machines.
|
|
|
|
|
|
#14 | |
|
Jul 2006
Calgary
52·17 Posts |
Quote:
Frankly I don't recomend any of them, I prefer the crontab @reboot command. |
|
|
|
|
|
|
#15 |
|
"Mark"
Feb 2003
Sydney
3×191 Posts |
I tried the OP's method in Ubuntu, but all I got was this error message : "su: must be run from a terminal". I think they've disabled su in scripts as a security measure. A bit of googling only found people trying to run something as root in a script. I've set up the crontab @reboot method instead.
|
|
|
|
|
|
#16 | |
|
Sep 2013
116 Posts |
Quote:
I installed the software in the directory '/opt/mprime'. This directory and all its files are owned by user 'nick'. To have 'cron' automatically start the program, I created a file mprime in the /etc/cron.d directory. This file must be an ordinary text file; it must be owned by root; and it must not be write-able except by root. The file contains a single line: @reboot nick /opt/mprime/mprime -w/opt/mprime You can create the file with your favorite text editor, or by executing the following command (the "%" represents the prompt and is not typed as part of the command): % sudo bash -c "echo '@reboot nick /opt/mprime/mprime -w/opt/mprime' > /etc/cron.d/mprime" In my example, the program runs as user 'nick'. Replace 'nick' with the name of a non-privileged user and the path '/opt/mprime' with the complete path to the directory where 'mprime' lives. If 'mprime' doesn't start after rebooting, you can check for an error message with this command: % sudo fgrep cron /var/log/messages I'm using SuSE 12.x. I believe this will also work on Debian/Ubuntu, but I have not tested that myself. |
|
|
|
|
|
|
#17 |
|
Banned
"Luigi"
Aug 2002
Team Italia
2·3·11·73 Posts |
Five years have passed since the last message on topic.
Now, having Ubuntu, and wanting to run mprime in background (./mprime &) and unmanned at each restart of the computer, especially after a power blackout (quite frequent in this season in Italy), what script would you suggest? I have seen flavours of init.d, crontab and rc.local, with pros and cons, and would appreciate your actual hint. Thank you
|
|
|
|
|
|
#18 |
|
"/X\(‘-‘)/X\"
Jan 2013
2×5×293 Posts |
I still run it like this, in my personal crontab:
`@reboot screen -S mprime -d -m /path/to/mprime/mprime -d` Then I can reattach to see the output whenever. |
|
|
|
|
|
#19 |
|
Banned
"Luigi"
Aug 2002
Team Italia
2·3·11·73 Posts |
|
|
|
|
|
|
#20 |
|
"/X\(‘-‘)/X\"
Jan 2013
2·5·293 Posts |
|
|
|
|
|
|
#21 | |
|
If I May
"Chris Halsall"
Sep 2002
Barbados
100110001001112 Posts |
Quote:
Code:
@reboot ~/prime/mprime -d </dev/null >>~/prime/mprime.log 2>/dev/null & |
|
|
|
|
|
|
#22 | |
|
Banned
"Luigi"
Aug 2002
Team Italia
2×3×11×73 Posts |
Quote:
Thanks Mark and Chris. |
|
|
|
|
![]() |
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| mprime 28.9 - occassional segmentation fault during start | pessoft | Software | 0 | 2016-06-13 20:58 |
| Seeking help on packaging mprime for Debian | alexvong1995 | Linux | 3 | 2015-05-13 12:49 |
| Linux (debian/grub) help | LaurV | Linux | 10 | 2015-04-24 15:39 |
| HowTo: Switch to Linux to finish factoring | Batalov | Linux | 25 | 2009-09-18 06:38 |
| Debian package of mprime | Matt | Linux | 1 | 2007-02-22 22:36 |