Sponsored Content
Top Forums UNIX for Advanced & Expert Users Run shell script as different user Post 69898 by mskarica on Thursday 21st of April 2005 11:23:36 AM
Old 04-21-2005
Ok, I think I should rephrase my question. I did some more research on daemons, and I think I can ask my question better now.

A daemon is a process that runs in the background (like a fork), whithout user interaction (from what I read). So basically what happens is that when an email is received, and the shell script is invoked, a daemon is running the entire process. I need to find a way where I can make the daemon act as if it were a unix user so that the process is run as if the user is the one who is invoking the scripts that are called in the main script, rather than the daemon.

So my basic idea is: email is received, forwarded to a script (daemon is still the owner at the moment), in the main script first thing I want to do is change the user from the deamon to another valid unix account, so then everything that is performed from there on out is performed as if the unix user that I specify is the one who invoked everything.

Does that make more sense? Any ideas?

Thanks

Last edited by mskarica; 04-21-2005 at 12:30 PM..
 

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Have script run as a different user

Hi all, I'm a newbie to the Linux world. I have a script that needs to run under "UserB". But I don't want to give out the password to UserB. Is there a way to setup the script to run as "UserB" when UserA runs it. Thanks in advance for your assistance. (1 Reply)
Discussion started by: mikey20
1 Replies

2. UNIX for Dummies Questions & Answers

shell script run by user or cron job ?

My shell script runs fine both as a cron job and when i issue it. However, I wish to differentiate when it runs as a cron-job so the "echo" statements are not issued (they get mailed to me, which i don't want). I tried checking $USER but since the cron was created in my user that does not... (5 Replies)
Discussion started by: sentinel
5 Replies

3. Shell Programming and Scripting

how to run script? call other script? su to another user? make a cron?

Good morning. I am searching for "how-to"'s for some particular questions: 1. How to write a script in HP-UX 11. 2. How to schedule a script. 3. How to "call" scripts from the original script. 4. How to su to another user from within a script. This is the basics of what the... (15 Replies)
Discussion started by: instant000
15 Replies

4. Shell Programming and Scripting

Can root user run chmod 000 permission shell script?

Hi, I have a shell script file which is set to access permission 000. When I login as root (sudo su) and try to run this script, I am getting the Permission denied error. I have read somewhere that root admin user can execute any kind of permission script. Then why this behavior? However, I can... (1 Reply)
Discussion started by: royalibrahim
1 Replies

5. Shell Programming and Scripting

Forcing another user to run a shell script (su)

I'm trying to use su (as myuser) to force another user (theuser) to run a shell script (thescript.sh): su theuser -c /home/theuser/thescript.sh However I'm running this from another script, and it is asking for theuser's password. I would rather avoid displaying it in the file (using echo... (2 Replies)
Discussion started by: asdfgg
2 Replies

6. AIX

AIX How to run a Shell Script by changing the User

Hi All, Currently our application is running on the server having AIX 5.3 OS. What we intend to do is to run a shell script owned by another user and needs to be run as that particular user. I was trying to create a shell script using the su command before running the actual script (which... (4 Replies)
Discussion started by: acoomer
4 Replies

7. Shell Programming and Scripting

Best way to run a shell with different user

Hi , we got autosys for scheduling our jobs. Autosys user logs in to the Linux box and need to execute a shell script. problem here is user requires admin privileges on database to complete the task. Since scheduling is maintained by different team I don't want autosys user to have admin privileges... (1 Reply)
Discussion started by: rush143
1 Replies

8. Solaris

Run commans as no login shell user

Hi All, I have problem running a command with another user who has no login shell the os is solaris 10 i am root and doing the following: su user -s /bin/bash "ls" no output .. no error messages if su - user i got No directory Please use CODE tags as required by forum... (2 Replies)
Discussion started by: BF_DEV
2 Replies

9. Shell Programming and Scripting

Shell script run in a case statement call to run a php file, also Perl

Linux System having all Perl, Python, PHP (and Ruby) installed From a Shell script, can call a Perl, Python, PHP (or Ruby ?) file eg eg a Shell script run in a case statement call to run a php file, also Perl or/and Python file??? Like #!/usr/bin/bash .... .... case $INPUT_STRING... (1 Reply)
Discussion started by: hoyanet
1 Replies
CASPERD(8)						    BSD System Manager's Manual 						CASPERD(8)

NAME
casperd -- Capability Services friendly daemon SYNOPSIS
casperd [-Fhv] [-D servconfdir] [-P pidfile] [-S sockpath] [-Fhv] [-D servconfdir] [-P pidfile] [-S sockpath] DESCRIPTION
The casperd daemon hosts various services that can be accessed through libcapsicum's capabilities by programs running in sandboxes. For example it is prohibited to send UDP packets to arbitrary destinations when operating in capability mode, which makes DNS resolution impossi- ble. To make it possible the casperd daemon provides the system.dns service that proxies DNS resolution requests through a dedicated, non- sandboxed process provided by casperd. The casperd daemon can be started with the following command line arguments: -D servconfdir Specify alternative location of the service configuration directory. The default location is /etc/casper/. -F Start the casperd daemon in the foreground. By default casperd starts in the background. -h Print the casperd usage message. -P pidfile Specify alternative location of a file where main process PID will be stored. The default location is /var/run/casperd.pid. -S sockpath Specify alternative location of the unix(4) domain socket used to connect to the casperd daemon. The default location is /var/run/casper. -v Print or log verbose/debugging information. This option can be specified multiple times to raise the verbosity level. FILES
/etc/casper/ The configuration directory for casperd services. /var/run/casper unix(4) domain socket used to connect to the casperd daemon. /var/run/casperd.pid The default location of the casperd PID file. EXIT STATUS
The casperd daemon exits 0 on success, and >0 if an error occurs. SEE ALSO
cap_enter(2), libcapsicum(3), pidfile(3), capsicum(4), unix(4) AUTHORS
The casperd was implemented by Pawel Jakub Dawidek <pawel@dawidek.net> under sponsorship from the FreeBSD Foundation. BSD
October 26, 2013 BSD
All times are GMT -4. The time now is 01:43 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy