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
intrbald(1M)															      intrbald(1M)

NAME
intrbald - daemon for balancing interrupts SYNOPSIS
interval | DESCRIPTION
Balancing interrupts is a process which distributes interrupts across the available CPUs in an optimal fashion. This action is performed by (see intctl(1M)). Performing frequent CPU migrations between system partitions may require you to perform periodic balancing of interrupts. This is espe- cially true with systems that use WLM (Workload Manager), iCAP (Instant Capacity), and vPars (Virtual Partitions) products. If the fre- quency of CPU migration is high, then balancing of interrupts should be performed more frequently. The daemon monitors the system for imbalance in interrupt distribution. If an imbalance is detected after the specified interval executes to balance the interrupt distribution. uses the parameters from the configuration file for balancing the interrupts. For more information about the command, see intctl(1M) and the configuration file. The daemon is started from the general purpose sequencer script (see rc(1M)), at run level 2 and is killed at run level 1. By default, the daemon is not enabled. The daemon configuration file must be edited and the parameter set to in order to enable running the daemon. After setting to for the first time, you can start the daemon manually by executing the script Otherwise, the daemon will automatically start the next time the system is restarted. Any actions performed by the daemon are logged in and details of interrupt migrations performed will be logged in the file Options recognizes the following options: Instructs the running daemon to reexamine the configuration file If the parameter has been updated, then the running daemon uses the new value. If the parameter is set to then the running daemon stops executing. The daemon checks if the system requires any balancing of interrupts after interval seconds; the valid range is 5 seconds to seconds (see limits(5)). This value can also be specified persistently in the configuration file by setting the parameter. The default value is 60 seconds. Setting this value too small can cause unnecessary interrupt migrations. Gracefully kills the running daemon. intrbald rc Configuration File is the configuration file. The following parameters can be persistently specified in this configuration file: Specifies if the daemon should be started automatically during the system bootup process by the script. The daemon will only be started automatically if this parameter is set to NOTE: This value is by default. Before using the daemon, needs to be changed to in the file. Then the daemon needs to be started, either manually by running or it will be started automatically at next boot via the script. The daemon checks if the system requires any interrupt balancing after this interval. The interval is specified in seconds; the valid range is 5 seconds to seconds (see lim- its(5)). The default is 60 seconds. Setting this value too small could cause unnecessary interrupt migrations. RETURN VALUE
Exit values are: Successful completion. An error condition occurred. WARNINGS
The command can be executed only by the superuser. This command should be used only by performance analysts for performance tuning pur- poses. If the interrupts are not redistributed properly, a possible decrease in overall system performance can occur. Some processors can become overloaded while other processors will not be optimally utilized. FILES
configuration file. See the section above. script. start symbolic link. kill symbolic link. daemon log file. SEE ALSO
intctl(1M), ioscan(1M), rc(1M), limits(5). intrbald(1M)
All times are GMT -4. The time now is 10:23 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy