LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian
User Name
Password
Debian This forum is for the discussion of Debian Linux.

Notices


Reply
  Search this Thread
Old 05-06-2005, 01:05 AM   #1
fatman
Member
 
Registered: Mar 2003
Location: PA
Distribution: Ubuntu (x2)
Posts: 158

Rep: Reputation: 30
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?
 
Old 05-06-2005, 05:50 PM   #2
rjlee
Senior Member
 
Registered: Jul 2004
Distribution: Ubuntu 7.04
Posts: 1,994

Rep: Reputation: 76
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.
 
Old 05-06-2005, 05:56 PM   #3
gbhil
Member
 
Registered: Jan 2005
Location: /dev/input/chair0
Distribution: Slackware, Gentoo, Vector, Roll-your-own-with-GNU binutils
Posts: 174

Rep: Reputation: 30
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

Last edited by gbhil; 05-06-2005 at 05:58 PM.
 
Old 05-08-2005, 09:56 PM   #4
fatman
Member
 
Registered: Mar 2003
Location: PA
Distribution: Ubuntu (x2)
Posts: 158

Original Poster
Rep: Reputation: 30
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.
 
Old 06-06-2005, 11:22 AM   #5
benjalien
Member
 
Registered: Aug 2003
Location: Belgium
Distribution: Debian (i686/ppc/amd64)
Posts: 86

Rep: Reputation: 15
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
 
Old 06-07-2005, 08:13 AM   #6
fatman
Member
 
Registered: Mar 2003
Location: PA
Distribution: Ubuntu (x2)
Posts: 158

Original Poster
Rep: Reputation: 30
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.
 
Old 06-07-2005, 04:08 PM   #7
benjalien
Member
 
Registered: Aug 2003
Location: Belgium
Distribution: Debian (i686/ppc/amd64)
Posts: 86

Rep: Reputation: 15
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
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Linux boot up process Vs. Windows boot up process darkskull Linux - Software 7 12-30-2006 04:21 PM
boot script execute command as non-root user wampfler Linux - Security 7 09-24-2004 04:56 AM
Why doesn't the root user show when I boot up? kirby Linux - Newbie 5 12-17-2003 03:11 PM
load script during boot not as user root? ziggie216 Linux - General 1 11-20-2003 11:30 AM
boot process and switching user brianm Programming 3 03-28-2001 12:10 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian

All times are GMT -5. The time now is 07:23 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration