Software :: Bash-script : Start A User A's Process From Other Users?
Aug 26, 2010
A Tomcat server is installed under user A. Now I am going to write a script which will start this Tomcat server. And this script can be executed from other users (from there account). And if other user run this script, the process ID should be of user A, so that user A can start or stop this process any time. This means, at the beginning of the script I have set the process ID as user A. How to do this?
View 8 Replies
ADVERTISEMENT
Feb 7, 2010
I am using Sphinx search on my webserver and it quits after a certain amount of time leaving my search page broken.Here is a bash script that I want to run every 10mins via cron:
Code:
#!/bin/bash
if pgrep searchd | grep "[0-9]"
[code]...
View 24 Replies
View Related
Sep 13, 2010
$ uptime
09:55:00 up 7 days, 6 min, 2 users, load average: 0.00, 0.00, 0.00
..but I'm the only user logged in!
$ who -a
system boot 2010-09-06 09:48
run-level 2 2010-09-06 09:48 last=
[code]....
looks as though this is the culprit, but...
$ kill 5485
-bash: kill: (5485) - No such process
This process doesn't exist in the /proc folder or the output of ps. Does anyone know how this happened, and how to remove this ghost user from my system without a complete reboot? I think I have seen a similar thing on a RedHat machine ages ago but I have never figured out how to log out these ghost users.
$ uname -a
Linux ubuntu 2.6.24-28-server #1 SMP Wed Aug 25 16:07:16 UTC 2010 i686 GNU/Linux
View 9 Replies
View Related
Jun 25, 2010
I have an Ubuntu server in which a file is dumped every hour and a new file for the next hour and the process continues. If there is any problem due to which the creation of file stops then empty files are created every minute till the process is killed & started again. I need help to make a shell script to check if the empty files are being created and then kill the process and start it again.It would be a great help if anyone can help me regarding this.
View 9 Replies
View Related
Jan 1, 2010
I have got a bash script i have been playing with I need to start a process then close terminal with in the script but leave program running ?
Code:
#!/bin/bash
sudo ifconfig eth0 down
sleep 5
sudo ifconfig eth0 up
firefox & exit
View 9 Replies
View Related
Jan 19, 2010
I'm trying to find how to schedule a process to start at a specific time (not on start up). How would I schedule a process/application to start at a specific time (if it matters, it will be a background process). For instance, have process abc start every weekday at 5am. I've done this for windows many times though have only been using linux regularly for a few months and haven't figured out the best way of doing this.
So far the best solution I have is to create a program that will start on boot and have it check the time and sleep until the required time and then start the required process(es) at the required time(s). But this seems more of a hack since I'd expect there to be a proper way of doing this.
View 4 Replies
View Related
Dec 10, 2009
I have 3 script BASH. I want start this script when the system start,stop and reeboot.
View 4 Replies
View Related
Jan 10, 2010
I need to control daemons like dhcp/bind from within a perl script. I could run the script as root to restart/stop/start the daemons however, this is not good for security.
What are the ways of controlling processes within perl as different users?
View 1 Replies
View Related
Jun 26, 2010
I am having a problem identifying a BASH script process that I run at startup.When I use "ps -e", I see a few BASH and SH processes running, but I don't know if any of these are my script. Is there a way to give a BASH script a specific name when run that I could see as the process name. That would make it easier to identify and kill when needed.
View 3 Replies
View Related
Mar 13, 2009
I am trying to give access to ONE single user to start and shutdown tomcat server. The problem being, when I enter syntax: username ALL= /etc/init.d/tomcat5, /usr/local/tomcat/webapps, PASSWD:ALL This gives the user access to start and stop tomcat but also gives user access to start and stop other services within /etc/init.d - such as httpd etc... What is the proper way to give user access to start and stop service, and limiting that power to only one service....
View 2 Replies
View Related
Nov 17, 2009
Urgent: on reboot, the Fedora 11 lower bars reach about 70-80%, then I get the message:
/dev/mapper/VolGroup-lv_root: (There are 22 inodes containing multiply-claimed blocks.)
File /home/burnie/.thumbnails/normal/[bunchofhexits].png (inode #15826, mod time Mon Nov 2 04:24:26 2009) has 13 multiply-claimed blocks, shared with 1 file:
[code]....
Just in case this is relevant, yesterday I spent several hours attempting (and failing) to build IcedTea in order to run a Java web service that required it. After the failure occurred, I exited Linux and went to Windows Vista to run the web service, and found that Vista cannot support 64-bit Firefox, so I rebooted to Linux, and ran make clean on the Iced Tea installation, which balked because a stamps directory could not be deleted because it was not empty; I followed this by make distclean which made the same complaint. So I manually deleted the files in the stamps subdirectory, ran make distclean "cleanly", and then rebooted to reach my current very unsatisfactory state.
View 6 Replies
View Related
Aug 23, 2010
I'm trying to write a script that involves storing a specific PID in a variable. I've got as far as: -
Code:
$PS_OUTPUT=ps -elf | grep <process name> | awk '{print $4}'
This stored the PID of the grep itself and the actual process I want. The output of
[code]...
View 6 Replies
View Related
Nov 25, 2010
file allids consists of 300,000 rows, each containing a 5-7 digit numeric id. file newids consists of 20,000 rows of id's. How do you explain the following timings? time: 0.07s:
Code:
diff <(sort allids) <(sort newids)
time: 1.6s:
[code].....
View 4 Replies
View Related
Mar 29, 2011
I want to execute a bash script that switches user and then executes a series of commands. None of this users have root privileges. I guess I have to edit the sudoers file to give user1 (the user executing the script) privileges to be able to log as user2 with no password prompt. I've been looking for this example but I haven't found any.
View 3 Replies
View Related
Nov 23, 2010
installed Ubuntu Server Edition and I've found that my first user has a bash history and I can turn on a coloured prompt by editing my .bashrc etc but new users don't have that!I did : useradd -d /home/newb -m newbpasswd newband the correct looking .bashrc file appears to be in /home/newb but it is being ignore by bash when logged in as newb. Instead I am presented with just a dollar prompt instead of "newb@server"how can I sort out my users with proper prompts?
View 1 Replies
View Related
Oct 28, 2009
Is It possible to change a process running in root-user to non-root-user by setting suid / uid / euid / gid etc... I so please instruct how, when and wat to set in order to change a process running in root-user to non-root user
View 4 Replies
View Related
Apr 1, 2010
pretty simple. how would you background a process from a script and get its process id at the same time?
View 6 Replies
View Related
May 27, 2009
I am new to scripting and been working on this bash script for awhile now. I been researching this problem, but I can't seem to find a solution. I was wondering if someone could please help me out. Here is my script:
#!/bin/bash
NO="ps -ef | grep NO | grep -v grep"
NOWC=`ps -ef | grep NO | grep -v grep | wc -l`
[code].....
I cannot get this script to run the "ps -ef" command on the client. It get its value from the host machine that I am running this script from. I need this command to execute on the client. When I run the command (ps -ef | grep NO | grep -v grep) on the client, I get something back. Here is what I get when I try to debug the script.
XX# ./test_ps5.sh XXXXX
+ NO='ps -ef | grep NO | grep -v grep'
++ ps -ef
[code]....
View 5 Replies
View Related
Oct 17, 2010
I have started using Ubuntu and I have to add a large number of users, over
a thousand, using a Bash Script. I also have to give them a password. Do you create a text file first.
View 1 Replies
View Related
Oct 4, 2009
I have a CentOS dedicated server running ProFTP. I have created user accounts which are meant for FTP access only but the users cannot connect to the FTP unless their shell access is /bin/bash
Here is an example line that is outputted when I use this command:
This user can access the FTP fine, but he can also access SSH which I don't want to allow him to do. If I set his shell access to /bin/false then he can't connect to the FTP.
What can I use in instead of /bin/bash to allow FTP but don't allow SSH?
View 2 Replies
View Related
Jun 7, 2010
I need to figure out a bash command to list all users logged in at or after 5pm - 5pm being the specifier in the command.
Code:
Command seems to be the easiest way to display users but it specifies all users log times.
I've also fiddled with the lastlog command to no avail.
View 2 Replies
View Related
May 14, 2009
I was asked to list passwordless or locked accounts in a fedora system. As far as I know, fedora or RH dont allow passwordless accounts (the system locks the account Edit: ... unless you set passwd -d :-P ), so I might show info about locked accounts.
I am totally aware that I could do a grep or an awk searching for "!!" or "", but my people is asking me to check against passwd -S (which prints info of accounts). The thing, is that in Solaris you can check with passwd -a -s all the users, but in Linux I couldnt find anything similar. what approach do you reccomend for passing, say , the list of users ( like the output of awk searching only user names) to the command passwd -S one by one?
View 4 Replies
View Related
Jul 28, 2011
I have a computation going which takes a long, but uncertain, amount of time. I have another computation which needs to be run, but _after_ the first one is done. I won't be at the computer at that time to manually start the new process. I've done some Googling, and I found how to delay execution by a specific amount of time (e.g. "start process x in exactly 8 minutes from now), but that isn't quite what I want to do. Essentially, I'd like to tell the shell, "When process #nnnn finishes running, then start process x". Is there a way to do this?
View 6 Replies
View Related
Mar 14, 2010
Further to solved LQ thread Bash: how to populate a list of arbitrarily named files?, what is the functional difference between feeding a loop with process substitution and feeding it with a here string with embedded command substitution? ABSG pages: process substitution, here string and command substitution. This works
Code:
while IFS= read -r -d '' file
do
files+=("$file")
done < <(find $dir -type f -print0)
[code]....
View 2 Replies
View Related
Jul 29, 2011
I've been asked to do certain jobs doing scripts in bash and perl. So this time they asked me to check which users hasn't been able to loggin. DONE with Code: lasb Now they asked me to show how many times all the users have input certain Bash Commands like
Code: Ls Cd pwd I was wondering if there was a command of something that could show me how many times those commands has been used, I already know I can see all input with Code: history Sorry I'm really new to this, been working with this for a couple of weeks, and its really interesting.
View 3 Replies
View Related
Mar 14, 2011
This is my sample code in /etc/httpd/conf.d/applications.conf file currently we are creating subdomain mannually for every new subdomain. I want to automate this process througs bash script , how its possible.
Code:
<VirtualHost *:80>
ServerName google.com
ServerAlias google.com
[code]....
In this code which i marked BOLD that content only we'l change for every subdomain. while manually doing this most of the times errors are coming to avoid that i need to automate this process.
View 3 Replies
View Related
May 26, 2010
First post from a very new Linux user....I am trying to create a BASH script that will allow user to provide multiple directory names, Checks if the directory exists and if not create the directory.
I am using the following code:
Which works fine as long as the user enters a single directory name. How can I modify this so it will process all directory names user enters on the read response?
View 5 Replies
View Related
Jan 12, 2010
I list the process with
Code:
ps -ef | grep java
and I got:
Code:
user1 24041 ....
Here the user1 should the process name.
My question: Is this name the same as the user name?
View 2 Replies
View Related
Mar 29, 2010
I need show the number of process per user, and after the date of the oldest process per user also.
With "ps -eo user | sort -u" i get all users that are running any process. And with "ps U username | wc -l" i get the number of process that the user "username" is running.
But how can i merge both commands for do what i need? Like a FOR or something like that. There is any method of make a FOR using the list that i get with the first command?
And then for show the date of the oldest process.. with "ps U username | sort -k 4" (4 is TIME field) i can show the process of the user "username" sorting they by time. But how can i get the date of the process takes longer running?? I can get only the time, but no the date.
View 9 Replies
View Related
Sep 1, 2011
set up BASH scripts on the server to automatically download and process data, and then upload it to my website. Is it even possible? Do servers allow website owners to place BASH scripts that can run automatically, or keep running indefinitely?
View 5 Replies
View Related