LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices

Reply
 
Search this Thread
Old 09-26-2006, 04:44 AM   #1
ferradura
Member
 
Registered: Jun 2006
Location: PT
Distribution: CRUX & Slackware
Posts: 100

Rep: Reputation: 15
auto login + run programs


i wanted to auto login as a normal user at boot time so i tried:
nano /etc/rc.d/rc.local
adding su - username
sucess

but i can`t run local commands here right?



but know i also want to be able tu run a program, noip+opendchub. tried that ~/.profile tip but did not work.
is there a way i can run programs/commands automatically?

because i just want to press the power button and then let the machine do its job...
thanks

Last edited by ferradura; 09-26-2006 at 06:06 AM.
 
Old 09-26-2006, 05:48 AM   #2
cybi
LQ Newbie
 
Registered: Feb 2006
Location: Poland
Distribution: slackware-current
Posts: 10

Rep: Reputation: 0
you can put `sudo -u user commmand` in the /etc/rc.d/rc.local to automaticaly start those apps it works for me
 
Old 09-26-2006, 04:49 PM   #3
ferradura
Member
 
Registered: Jun 2006
Location: PT
Distribution: CRUX & Slackware
Posts: 100

Original Poster
Rep: Reputation: 15
i dont use sudo, nor know how to...

my rc.local:
Code:
su username
su username program
and the output is a correct login of the user +
Code:
bash: no job control in this shell
what to do?
 
Old 09-26-2006, 05:03 PM   #4
raska
Member
 
Registered: Aug 2004
Location: Aguascalientes, AGS. Mexico.
Distribution: Slackware 13.0 kernel 2.6.29.6
Posts: 816

Rep: Reputation: 30
use this
Code:
su - <user> -c "command"
 
Old 09-26-2006, 05:22 PM   #5
cybi
LQ Newbie
 
Registered: Feb 2006
Location: Poland
Distribution: slackware-current
Posts: 10

Rep: Reputation: 0
...or this

Code:
sudo -u user_name program_to_execute
 
Old 09-28-2006, 02:29 PM   #6
ferradura
Member
 
Registered: Jun 2006
Location: PT
Distribution: CRUX & Slackware
Posts: 100

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by raska
use this
Code:
su - <user> -c "command"

still no jobs in this shell
 
Old 09-28-2006, 02:55 PM   #7
cybi
LQ Newbie
 
Registered: Feb 2006
Location: Poland
Distribution: slackware-current
Posts: 10

Rep: Reputation: 0
firstly su root and check those commands which you entered in rc.local then there is a question like this

if no error displayed the check is there any output while system start and executing rc.local

if still nothing the pipe the standard error output from the program you try to execute to some file like ~/rc.error.log
 
Old 09-28-2006, 03:46 PM   #8
Alien Bob
Slackware Contributor
 
Registered: Sep 2005
Location: Eindhoven, The Netherlands
Distribution: Slackware
Posts: 5,194

Rep: Reputation: Disabled
Quote:
Originally Posted by ferradura
i dont use sudo, nor know how to...
I once wrote a little bit about using sudo and su here: http://alien.slackbook.org/dokuwiki/...linux:admin#su

Eric
 
Old 09-30-2006, 08:34 AM   #9
ferradura
Member
 
Registered: Jun 2006
Location: PT
Distribution: CRUX & Slackware
Posts: 100

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by ferradura
still no jobs in this shell
i keep getting the same error message, even if i run the command as root...no jobs in this shell.

can it be a bash problem?
is there other ways to start up programs/services/daemons at boot time?
 
Old 09-30-2006, 11:47 AM   #10
dive
Senior Member
 
Registered: Aug 2003
Location: UK
Distribution: Slackware
Posts: 3,203

Rep: Reputation: 292Reputation: 292Reputation: 292
Doesn't it work just putting the names of the programs in rc.local after su - <user>? IE:

su - dive
/usr/bin/noip
/usr/bin/opendchub

??

Last edited by dive; 09-30-2006 at 11:49 AM.
 
Old 10-01-2006, 08:47 AM   #11
ferradura
Member
 
Registered: Jun 2006
Location: PT
Distribution: CRUX & Slackware
Posts: 100

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by dive
Doesn't it work just putting the names of the programs in rc.local after su - <user>? IE:

su - dive
/usr/bin/noip
/usr/bin/opendchub

??
those are the programs that i am trying to run...
it won`t work if i try to run as a user, it will only work as a daemon...those su - user commands do not work...

/etc/rc.d/rc.local is like this know
Code:
noip
sleep 20
opendchub
i am running the programs as daemons, since i have not found a way to do run them trough a user

thanks anyways
 
Old 10-04-2006, 04:11 AM   #12
fotoguy
Senior Member
 
Registered: Mar 2003
Location: Brisbane Queensland Australia
Distribution: KirraMail Live Email Server
Posts: 1,276

Rep: Reputation: 61
Quote:
Originally Posted by ferradura
i am running the programs as daemons, since i have not found a way to do run them trough a user
The reason you have to run them as daemons is a normal user does not have permissions to execute binaries or scripts outside there home directory. The rc.local file is executed by root so everything placed in there will run with root permissions.

As for autologin, KDE and Gnome have an autologin feature, if you not using them you could try uing the /etc/inittab file to autologin
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
How do I make my programs auto start on login? martinr Fedora 2 04-11-2006 10:00 AM
auto launch programs at login desmondtm Linux - Newbie 1 12-01-2005 04:51 PM
auto run programs at startup?? attila_66 Linux - Newbie 4 10-29-2005 06:01 PM
Auto login and run firefox at a specific web page eraser Linux - Newbie 4 11-21-2004 05:34 PM
Auto-starting programs after login BeNe.WS Linux - Software 4 07-30-2003 07:46 PM


All times are GMT -5. The time now is 07:37 PM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration