LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Debian (https://www.linuxquestions.org/questions/debian-26/)
-   -   Boot process as non-root user (https://www.linuxquestions.org/questions/debian-26/boot-process-as-non-root-user-320619/)

fatman 05-06-2005 01:05 AM

Boot process as non-root user
 
I have an AMD64 box running sarge - meant for a HTPC with mythtv compiled from source (v0.18) - there are no AMD64 Debian mythtv packages. After a long period of problems, I almost have it working.
However, upon bootup the following script
Code:

# Check the SQL database and fix if necessary(disabled for now)
# mysqlcheck -r mythconverg

# Start the lirc daemon
/usr/local/sbin/lircd -d /dev/lirc0

# Start mythbackend
/usr/local/bin/mythbackend > /home/matt/mythbackend.log 2>&1 &

starts the 'mythbackend' process, owned by root using the following symlink:

# ls -l /etc/rc2.d/S91mythbackend
lrwxrwxrwx 1 root root 23 2005-05-05 20:52 S91mythbackend -> /etc/init.d/mythbackend

I am pretty sure i need to run mythbackend (and lircd) upon startup owned by my regular user ('matt') and not root - what do I need to do?

rjlee 05-06-2005 05:50 PM

Re: Boot process as non-root user
 
I would modify the script to run the command as matt:
Code:

# Check the SQL database and fix if necessary(disabled for now)
# mysqlcheck -r mythconverg

# Start the lirc daemon
/usr/local/sbin/lircd -d /dev/lirc0

# Start mythbackend
su matt - -c '/usr/local/bin/mythbackend > /home/matt/mythbackend.log 2>&1 &'

Because the script will be called as the root user, you won't be prompted for a password.

gbhil 05-06-2005 05:56 PM

run this by hand to see that it works, then just add to /etc/rc.d/rc.local

Code:

# Check the SQL database and fix if necessary(disabled for now)
# mysqlcheck -r mythconverg

# Start the lirc daemon
nohup su matt -c '/usr/local/sbin/lircd -d /dev/lirc0'

# Start mythbackend
nohup su matt -c '/usr/local/bin/mythbackend > /home/matt/mythbackend.log 2>&1' &


not 100% sure that this will fly in Debian. If you try it let me know the outcome please.

EDIT - rjlee beat me to it ;)

fatman 05-08-2005 09:56 PM

Thanks for the help - appears to running fine.

Here is what the opertional script looks like:

Code:

# Check the SQL database and fix if necessary: (disabled for now)
# mysqlcheck -r mythconverg

# Start the lirc daemon
nohup /usr/local/sbin/lircd -d /dev/lirc0 &

# Start mythbackend
nohup su matt /usr/local/bin/mythbackend > /home/matt/mythbackend.log 2>&1 &

I couldn't get the -c option with su to work properly, and i have to run lircd as root.

benjalien 06-06-2005 11:22 AM

Ho wdid you do that?
 
Hi,

I have an AMD64 (sarge) too, and I can't get mythv to work, this is what I got:

Code:

ldd /usr/local/bin/mythtv | grep not
        libmythtv-0.18.1.so.0 => not found
        libmythavformat-0.18.1.so.0 => not found
        libmythavcodec-0.18.1.so.0 => not found
        libmyth-0.18.1.so.0 => not found

I'm quite fed up with those lib32 lib64 problems...

How did you get around that problem (I think you had it too, didn't you?)

Benjamin

fatman 06-07-2005 08:13 AM

I don't think I had that particular problem, but I never knew what the command 'ldd' did until I googled it just now.

I had some library problems during installation.
One set went away when I compiled with gcc 3.4 instead of gcc 3.3 (careful - gcc 3.4 caused major headaches when I tried to install it under 2.6.8, had to use 3.3 to compile the kernel up to at least 2.6.10, and then install 3.4)
The other set was related to X, I had to manually correct a lib64 symlink before installation of my nvidia drivers.

I have a fairly detailed command-by-command instruction of how I built the system up from a bare hard drive. I was going to post it here as a HOWTO as soon as I ironed out the last few problems:
- My own stupidity in choosing ReiserFS for the /video partition, and then not including support for it in the kernel, (I couldn't figure out why it would quit recording after a few hours - it was filling up the / partition!) The last recompile of which then knocked out the remote
- Settling on a better mapping for my remote keys
- Checking for readability and errors
- Getting a chance to upgrade to v18.1 from v18

You're welcome to it in its primitive state, if you like - maybe i'll see if it can be posted here in incomplete form.

benjalien 06-07-2005 04:08 PM

A howto? Great!
 
Hi fatman,

that sounds great, if you want you can mail me your document and I'll tell you if can help a non-geek to get it to work!

Benjamin


All times are GMT -5. The time now is 10:22 PM.