LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
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 01-12-2007, 10:20 PM   #16
H_TeXMeX_H
LQ Guru
 
Registered: Oct 2005
Location: $RANDOM
Distribution: slackware64
Posts: 12,928
Blog Entries: 2

Rep: Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301

If I understood this correctly, '$tor_user' is used by tor to run itself for that user.

To change this variable (assuming it isn't readonly, and there is no reason it should be):

Code:
export tor_user=user_name_goes_here
So if your user name was bob:

Code:
export tor_user=bob

Last edited by H_TeXMeX_H; 01-12-2007 at 10:21 PM.
 
Old 01-12-2007, 11:26 PM   #17
WilliamS
Member
 
Registered: Nov 2003
Location: 46N 76W
Distribution: Slackware 14.1
Posts: 380

Original Poster
Rep: Reputation: 31
I tried that, and other variations I can think of either stop it from working or make no difference, still being run as root.
Don't see why username should make any difference, as long as it IS a valid user.

It does run the app, so it must be a valid username, seems the problem of root instead of user is elsewhere.

Last edited by WilliamS; 01-12-2007 at 11:31 PM.
 
Old 01-13-2007, 03:21 AM   #18
blackhole54
Senior Member
 
Registered: Mar 2006
Posts: 1,896

Rep: Reputation: 61
Quote:
Originally Posted by WilliamS
I think the problem is here " $tor_user (you need to define it in your script) refers to the user you want to run tor."
I've created a new user, but how do I define it in the script? Just writing $user1 in place of $tor_user didn't do it.
You don't even need to export it. Using the above example, somewhere near the top of your script just put:

tor_user=bob

With my perverse sense of humor, I created a user called onion. In that case you would say:

tor_user=onion

Without such a definition, the su command just changed to another login of root which is why you got that warning. BTW, if you test the script manually, make sure you invoke it while you are root.

EDIT: The above assumes you leave the command as I wrote it. If you want to put the user's name in that line, you don't need commands like the above, but you also should not put a dollar sign in front of the user's name. The dollar sign tells bash that you are referring to a variable.

Last edited by blackhole54; 01-13-2007 at 03:27 AM.
 
Old 01-13-2007, 03:35 AM   #19
blackhole54
Senior Member
 
Registered: Mar 2006
Posts: 1,896

Rep: Reputation: 61
Sorry, I didn't see your last post when I posted #18 ...

Quote:
Originally Posted by WilliamS
I tried that, and other variations I can think of either stop it from working or make no difference, still being run as root.
Don't see why username should make any difference, as long as it IS a valid user.

It does run the app, so it must be a valid username, seems the problem of root instead of user is elsewhere.
You are putting a dollar sign in front of the user's name? If so, bash will interpret the user's name as a variable, which you have not defined. This has the effect of leaving it out entirely! W/o a username supplied, su's behavior is to use root. I hope this is clear.
 
Old 01-13-2007, 11:09 AM   #20
WilliamS
Member
 
Registered: Nov 2003
Location: 46N 76W
Distribution: Slackware 14.1
Posts: 380

Original Poster
Rep: Reputation: 31
Aha!
Deleted the $ and all is well. The current line is:
Code:
su - wilhelm -c "killall tor  &> /dev/null && sleep 2;  /usr/local/bin/tor &> /home/william/jk  &"
Thanks again, blackhole54.
 
Old 01-13-2007, 11:53 PM   #21
blackhole54
Senior Member
 
Registered: Mar 2006
Posts: 1,896

Rep: Reputation: 61
Glad it worked out.

FYI, if you would prefer to log to the system log instead of your private file, you can put the line

Log notice syslog

in /usr/local/etc/tor/torrc. If you are modifying torrc.sample, I think you can just uncomment a line for this. (The last time I looked at the sample file was several versions ago.)
 
Old 01-14-2007, 08:08 AM   #22
WilliamS
Member
 
Registered: Nov 2003
Location: 46N 76W
Distribution: Slackware 14.1
Posts: 380

Original Poster
Rep: Reputation: 31
Yes, still the same. Uncomment would be all needed, however the file I made gets erased and re-written every connect, so no problem and syslog is already cluttered with boot messages and mysterious stuff such as "Jan 14 07:35:43 host pppd[3185]: Cannot determine ethernet address for proxy ARP
Jan 14 07:36:36 host pppd[3215]: Cannot determine ethernet address for proxy ARP"

This machine has no ethernet card. (Where's that head-scratching smilie?)
 
  


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
I Kindly need some linux scripting project advice mosesmungai Programming 4 12-05-2006 08:59 AM
Bash Scripting newb.. Advice needed. trey85stang Linux - General 5 09-28-2006 12:05 PM
help on bash scripting Kendo1979 Linux - Newbie 3 05-17-2005 07:10 PM
need help with bash scripting rich2oo1 Programming 2 12-17-2003 12:50 PM
BASH scripting help Chucklez Linux - Newbie 4 12-12-2002 12:07 PM

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

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

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