Red Hat / Fedora :: Getting User Input In A Shutdown Init.d?
Feb 25, 2010
I have a service that when shutdown requires a username and password. I use `read` in my script to gather this info because I can't have it in the file. When I run the init script by hand it will ask for the username and password and everything shutsdown properly. When I run reboot or halt I get no prompt. get user input in a shutdown process?
View 2 Replies
ADVERTISEMENT
Jul 30, 2011
I'm trying to make a script that loads at boot and asks for user input before doing it's stuff. So I created a script in /etc/init.d/ following the example given there (skeleton file) and used update-rc.d to make it load before GDM.
But when my script requests user input, init doesn't stop, and goes on loading other services and loads GDM. I have to CTRL+F1 to get to my script. I want my script to pause the init system till it ends doing it's stuff and the the other services can go on loading.
I tried
#X-interactive: true to no avail.
View 1 Replies
View Related
Feb 9, 2010
I'm working to make guest OS run as no privileged user. I've found a script made by an Italian guy that should start the guest instance during boot. Unfortunately the script was made for Debian and as I'm not confident with bash, I'm having some difficulties in making it work under RedHat 5.3 launched as root
vbox-ithaca start
vbox-ithaca: line 116: log_daemon_msg: command not found
sudo: VBoxManage startvm ithaca --type vrdp: command not found
vbox-ithaca: line 119: log_end_msg: command not found
these errors to me basically say that those commands aren't in PATH, but I couldn't find them anywhere
[code]...
View 1 Replies
View Related
Sep 30, 2010
I want to shutdown my computer as if power was cut off (don't ask me why). How do I do this under Linux?
View 6 Replies
View Related
Mar 28, 2010
see if there are differences between init 0 and shutdown -h now?
View 3 Replies
View Related
Feb 15, 2010
Im having a bit of a problem with a init script which I wrote to start and stop oracle listener and database. My system is Redhat 5.4 64bit and oracle 10g2 standard database (64). I have created the script and added the script using
chkconfig add orashut, and on the script by chkconfig level 345 orashut on Now I can use service orashut start, stop, restart, and works fine and when the system comes up the database and the listener would come up as planed. But the problem is when I do a reboot or shut down the db or the listener would not shutdown as expected, I placed at K00 values as well in rc0.d and rc6.d to give the priority at the shutdown. Even though all the configurations say this script should run before everything else at the shutdown time this is not working.
View 6 Replies
View Related
Jul 7, 2011
When I bring down a certain machine with some nfs mounts using init 0, it hangs forever while trying to bring down the mounts, but if I bring it down using halt -p (which I've read just calls shutdown if I'm in init 3), it comes down in a timely manner. I've also read that shutdown still calls all the rc.d kill scripts just like init 0, so what is actually the difference between them? Is it this:
Quote:
All processes are first notified that the system is going down by the signal SIGTERM?Does init not do that? I'm not trying to directly troubleshoot why NFS makes me hang with init 0 at this point, just wondering why shutdown works whereas init 0 doesn't.
View 4 Replies
View Related
May 29, 2009
I have an init.d script (dahdi-redfone) that works perfectly if you call "service dahdi-redfone stop" but for some reason when I reboot or shutdown it never gets called.Below in the listing of my rc6.d directory
# ls /etc/rc.d/rc6.d
K01dnsmasq K05anacron K20nfs K65dahdi-redfone K85messagebus K88auditd K90bluetooth K99readahead_early
[code]....
View 8 Replies
View Related
May 30, 2011
How to add "shutdown" to the user menubar?Everytime I want to shutdown I have to logout and then from there shutdown/restart. Is there a way to add shutdown/restart/hibernate to the user menu bar?How do I add applications to startup? I don't find that option in the system settings !
View 2 Replies
View Related
Sep 25, 2009
I'm sure you all seen how you can use curl to post to you twitter acct. What I'm wondering is how to add a variable to take user input and post that imput.
Code:
#!/usr/bin/perl
"Enter tweet: ";
$msg = <STDIN>;
[Code]...
View 3 Replies
View Related
Oct 1, 2010
I try to shutdown a box running Fedora (fc12, all updates applied) remotely. From various threats I selected the following way that suits best to my needs: I edited the entry for shutdown in /etc/passwd:
shutdown:x:6:0:shutdown:/sbin:/usr/bin/sudo /sbin/shutdown -h +1
Logging in from a tty with shutdown gives the desired result: The computer does the shutdown. Then I tried the same using sshd and plink:
plink -t -l shutdown -pw xxx 10.0.0.123
As a result I get:
Using username "shutdown".
Access denied
Access denied
shutdown@10.0.0.123's password:
The /var/log/secure shows the following entry:
Oct 2 00:40:46 rotgschirr sshd[6841]: User shutdown not allowed because shell /usr/bin/sudo /sbin/shutdown -h +1 does not exist
Oct 2 00:40:46 rotgschirr sshd[6846]: input_userauth_request: invalid user shutdown
Oct 2 00:40:46 rotgschirr unix_chkpwd[6847]: password check failed for user (shutdown)
Oct 2 00:40:46 rotgschirr sshd[6841]: pam_unix(sshd:auth): authentication failure; logname= uid=0 euid=0 tty=ssh ruser= rhost=rotgschirr.totes-gebirge user=shutdown
Oct 2 00:40:48 rotgschirr sshd[6841]: Failed password for invalid user shutdown from 10.0.0.123 port 37195 ssh2
Oct 2 00:40:50 rotgschirr sshd[6846]: Connection closed by 10.0.0.123
Somehow when using ssh the shell /usr/bin/sudo /sbin/shutdown -h +1 cannot be found.
View 5 Replies
View Related
Feb 9, 2011
I wrote a custom init script for a java application. The script resides in /etc/init.d and follows the convention for the init.d scripts. However, the script runs the java process as root. I need these processes to run as a non-root user. Is there a way besides using sudo or su in the script (seems inelegant), to run the script as a specific non-root user? Perhaps using a .conf file in /etc/init or a daemon wrapper? What would the Ubuntu way of doing this be?
View 2 Replies
View Related
Feb 5, 2011
Recently I installed vncserver (tigervnc) on my desktop. Ever since my computer refuses to shutdown normally. At shutdown the following message pops up: Quote: System policy prevents stopping the system when other users are logged in Then I have to enter the root password to shutdown. If I stop vncserver before, the computer shuts down normally.
[Code]....
View 2 Replies
View Related
Nov 27, 2009
I have installed the Apache Directory Server (ApacheDS) Now I need a iniscript that startining the App as Root, so that it can use the Port 389. After them a unprivileged User (apachds) should run the Service. The same solution I am searching for Glassfish. What can I use for them? RHEL and compatibles doesn't have a start-stop-daemon like Debian.
View 3 Replies
View Related
Nov 5, 2009
I have a section of a script that is supposed to change the filename of similar files in a directory. It works the way I need it to work, except that I would like to input the new filename each time it runs without having to edit the script.
I capture 5-6 images into ~/screenshots. They are labeled Picture 1.png, Picture 2.png, etc. I would like to be able to rename them as Lesson 1.png, Lesson 2.png, and so forth. It works if I hardcode the new NAME (Lesson) into the script, but I want to replace NAME with a variable that I can input at a prompt or pass into the script from another. I have tried setting a variable and replacing "Lesson" with $variable in line #11, but that leaves me with only the extension and no filename.
I have also tried using $1 on the command line:
Here is what I have that works:
How do I get a variable into this script?
View 2 Replies
View Related
Apr 28, 2010
I've written a bash script that allows a user to input a directory location to find out the size of the directory. However, if the user inputs a directory and finds its size then inputs another directory then wants to quit, the script asks the user numerous times if he wants to quit!! The script won't exit until the number of times the user looks at a directory is reached! What gives?
Here's the script:
Code:
View 4 Replies
View Related
Apr 8, 2010
I have a script in which it searches the password file for a username based on the user's input. Is there a way I can take the bad input and keep it in a variable. (one that keeps adding all the non-existent users)so how would I get non-existent users into another variable?
View 9 Replies
View Related
Aug 5, 2010
Write a program that requires the user to input the name of a file as an argument. If the user fails to include one argument it should make use of a thread that handles a signal. The signal handler should tells the user Incorrect number of arguments and then calls the terminate signal on the process.
If the numbers of arguments are correct then the program should allocate memory space to the file (5MB) and create a child process that requests the user for a character that it should send to the parent. The child should keep request for data until the user keys in the character O. During each request it should pause for 10 seconds, send the character to the parent and then requesting again for another character.
The parent should get the character from the child. Do not make the parent wait for the child to finish requesting for data. Make use of pipes to facilitate communication between the parent and the child. A second child should be created to read and display data from the file. Make use of any appropriate Inter Process Communication technique to ensure that the second child and the parent do not access the file simultaneously (Mutual exclusion).
View 5 Replies
View Related
Jun 2, 2009
I've been using python/bash to help myself automate things for a long time, however I am curious. One reason I use python more is because I don't quite know how to work with user input in Bash, such as getting it to ask for input and wait, and then placing that user input into a command.
Here's an example of a script I use from time to time for converting OGG video files into AVI.
How could I write this same script in Bash? Keep in mind I am mostly self taught, so I am by no means an expert programmer.
Code:
View 3 Replies
View Related
Apr 1, 2010
It seems little weird that I can shutdown my system (as non root user) from GUI but now from command line. I understand this may have to do with old unix tradition. I am now writing a script to shutdown systems after a certain period of inactivity. How do i shutdown system as non root users and without using sudo? Also the shutdown option in GUI must be calling a command line internally. Which is that option? Can I use that to shutdown system as non root user?
View 1 Replies
View Related
Jul 4, 2010
I am using LuckyBackup to back up my laptop disk to a USB disk. I would like to display to the user the message "Please mount backup disk" and have the user click "OK". LuckyBackup has a feature to allow issuing commands before it does the backup. I have been investigating scripts (I have never written one.), but do not understand how to use them to this end.
View 4 Replies
View Related
Jan 29, 2011
I'm trying to make a script to make it quicker to encode videos.
Code:
#!/bin/bash
echo "Type the path of the video file"
[code]....
View 9 Replies
View Related
Jul 15, 2010
I wanna trace user's command input history. but I dont plan to use "history", "lastcomm" becauze there is not detail of the user command history. if there is some software use to log user command to one file or database, it's suit for me.
View 1 Replies
View Related
Dec 2, 2010
I want ssh a remote server through shell script with predefines username and passwd. i dont know how to use expect command to do that.
View 4 Replies
View Related
Feb 26, 2010
in c how to read multiple lines from user input
using scanf it is not possible and using gets we can able to read one line at a time
hoe to read multiple lines at a time from user input....
View 1 Replies
View Related
Oct 26, 2010
I ve a script to delete a folder is given below:
1. I need a script to clear the cacheroot in my box.
2. What user mention to delete the folder that should ve to delete.
View 5 Replies
View Related
Oct 27, 2010
If I have an array which its size is based on the user input, from some material, I need to use malloc function to allocate memory for that array what is known dynamic array. Don't forget to free it.hat's fine, however, I like to try things out even I know the program will crash.I have written some test program on my Mac using C language like this:int width = 0;//get user input, and assign the input value to width, for example, 3char * array_var[width];and width is an int, its value will be assigned by the user input. The point is, this program work as expected, for example, in command line, I input 3, then array_var length is 3, its size is 3 * sizeof(char *).
View 1 Replies
View Related
Aug 9, 2009
I have a script im having some problems with, what I need is to have the system generate a random password for me and use that password when creating new users to it.
System is Debian Lenny and script is in bash.
The program is znc. I have made it so that it will generate the random password on the shell but the problem is to use it in the bnc software.
To make a password there the command is znc --makepass and look like this:
My question is now if it would be possible to put in the script so it would "answer" when it need those passwords ? the random password that is generated is in a variable called $setpass and is NOT crypted.
Or is there any other software that would be able to generate that md5 string for me ?
View 7 Replies
View Related
Jan 1, 2011
I've been dual booting 10.10 with Windows7 for about a month. Today is the first time I've encountered a serious problem.
This morning, nothing functioned properly after trying to open several programs. The computer seemed to be "frozen", although the mouse was working fine.
I decided to reboot, but then encountered an even bigger problem.
It failed to boot and got this message: no init found. try passing init= bootarg
The problem now is that it requires a Live CD session and I keep getting this: GLib-WARNING **: getpwuid_r(): failed due to unknown user id (0)
In case it matters, I didn't install 10.10 from an ISO, I just upgraded from 10.04.
View 2 Replies
View Related
Sep 29, 2010
My normal day to day user can't shutdown, restart, logout, etc...It just doesn't do anything at all when I try. This wasn't the case three days ago, just fresh installed and seeing the same problem (so it must be some setting saved in my home folder which wasn't wiped).
View 5 Replies
View Related