General :: Need Script For Automatic Shutdown
Jan 14, 2011I need a script for shutdown the system automatically if the system is not disturbed for last 10 minutes.
By the way i am using RHEL 4 in my system.
I need a script for shutdown the system automatically if the system is not disturbed for last 10 minutes.
By the way i am using RHEL 4 in my system.
I have installed Ubuntu as wubi (next to windows 7). When I expect the computer to shut down (either to hibernate or as part of, you know, shutdown), it doesn't. All the programs end, I am logged out, but I still have a picture on the screen (ubuntu default picture).
View 7 Replies View Relatedafter having far too many problems with other brown-coloured distros, I moved my MythTV box to SuSE (what all the other machines here use). Everything is working, EXCEPT for one thing: automatic idle shutdown. I cannot get MythWelcome to shut down the machine automatically (choosing shutdown now from it's menu does work). The log shows sudo: sorry, a password is required to run sudo (sudo -n) or the infamous "no tty and no askpass". (plain sudo)
I have added /sbin/shutdown to the sudoers file, and I can run sudo /sbin/shutdown -h now from the terminal and shutdown without a password... but sudo will NOT run from mythtv. I've even tried adding a special exception to the sudoers file, "Defaults !requiretty" with no luck. This is a dedicated frontend/backend with no user access (doesn't boot a desktop manager; goes straight to Mythtv) so I'm no too worried about potential security; the machine is on a LAN and cannot be accessed from the WAN side.
Is there a way to take a screenshot just before the "shutdown" terminal command? for example "sudo shutdown -h 90" for 90 minutes timer shutdown, and just before turning off to take a screenshot.
View 1 Replies View RelatedI found this script on another forum post (HERE) from a couple of years back.It doesn't work anymore for some reason and I'm looking for some assistance in making it work now. I really need to cut down my electric bill and my son is constantly leaving his desktop on for hours on end.Any gurus out there up to the challenge?I am attempting to re-write the "inactive=" line using w instead of who but I'm not having much luck yet.
View 3 Replies View RelatedI'm trying to make my system automatically shutdown once the battery level is low, but still without success. I've tried kpowersave, gnome-power-manager, kpower, klaptop but none of these worked for me. Well, I can't imagine I would be that stupid, but simply it doesn't work. In all cases mentioned above (kpower, klaptop, gnome-power-manager) I've tried to setup the laptop to shutdown once the defined level is reached, but the laptop never actually switched off unless all the battery was drained.
Btw. I think all the above mentioned apps only work once the user is logged in. But I'd like the solution to work also when the PC is on without anyone logged in. I thought I could write a bash script based on parsing of acpitools output and define it as a service, which would monitor the battery level, but I simply don't believe there isn't any functional solution to this.
I'm trying to make the power manager NOT automatically shutdown / sleep / hibernate when battery power of my laptop reaches critical
I am surprised there isnt an 'NO ACTION' option for that in power manager
I've tried editing the acpi-supper in /etc/default bu couldn't find a solution in there nor in the /home/user/.gconf/apps/gnome-power-manager/ directory
I cannot locate shutdown log for Linux shutdown to check various activities carried out during shutdown. I can view Startup Log which is availble on console>Applications>System Tools>System Logs.
I have included Shutdown/Startup in dbora, so that Oracle 10gR2 Shutdown/Startup will be automated during OS Shutdown/Startup.
I want to check Shutdown log because Oracle Shutdown was not running, as from $ORACLE_HOME/shutdown.log contains no entries, where as startup log contains latest startup details.
That means here 2 issues are there. One, I want to locate OS Shutdown Log and the other being Why Oracle Shutdown not getting executed.
I have installed a cluster computer with 10 nodes . The manufacturer is HP . All nodes and the master node have redhat enterprise linux installed in them . When I shutdown the nodes from the master terminal using "shutdown -h now" they get shutdown . But they dont get completely turned off . This issue bothers me when the power supply is given , all nodes boot up simultaneously generating a huge heat .
Thing to note : When we shutdown our PC they get completely turned off . When the power supply is given , a press on the Power On button is required to boot the system. But , why does it not happpen in the case of cluster? Is there any other way of completely turning off the nodes from the master terminal ?
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]....
when my pc boots and shuts down my monitor goes into 'input out of range' mode for a bit between the gui and the text only phases of boot/shutdown.is there a way to fix this? or where to start troubleshooting?also, when it shuts down it hangs after coming back to the text only part
View 4 Replies View RelatedI need to disable the automatic power-off on shutdown so I can just withdraw the power myself. The reason for this is that the machine should power on itself when it gets power (which is accomplished by Resume on Power Failure in BIOS). I learned that I can turn off ACPI and APM by using the corresponding boot command options. Does this have any negative effect other than disabling standby etc.? Is there another easy to accomplish solution for this problem (maybe using linux from a readonly partition and make sure all programs are closed before I withdraw the power)?
View 1 Replies View RelatedCan anyone tell me how to have Apache automatically start when I boot the system (and log in)?
It is a simple home-PC running Fedora and I put Apache on for internal/local use only (so I can get to it from my Windows box).
Right now, I have to su (to root) and run the Apache startup command.
I'd like to have it simply come up when I log-in.
I have installed CentOS 5.5 successfully and I have VNC working. This server will be a headless box that will reside in a server rack. I intend to perform any necessary maintenance on the machine remotely though my desktop computer. My problem is that when CentOS is on the login screen, I cannot connect with VNC. Once I have logged into a user account, then I can connect.
I would like the server to automatically login to one of my users each time it boots so that the VNC connection will be opened. Currently I have two users, root and Zachary. I would like the server to automatically login to the user Zachary.
In the CentOS Gnome GUI, when I go into System > Administration > Login Screen, and then click on the Security tab there is an option to "Enable Automatic Login." If you check this box a select form field becomes active; however, there are no user accounts showing in that select field. I tried typing in the user name that I wanted to automatically login, but after closing the screen it clears that username. What am I missing?
I have been using linux now for a very short time, and the more I use the more I like, however some things are just too far beyond me to figure out, like scripts, etc... So I do prefer to use GUI apps wherever possible, and I'm using SUSE 11.3I'm looking for a way to automatically manage a folder I use for auto downloads. I'd like to be able to at least:
Move files to another directory based on either the files age i.e. 2 weeks, or the remaining disk space on the disk to initiate a move function. (Preferably the 1st and then the 2nd if necessary)And then a function to lookup similar folder names and put the file into that folder if it exists. (More complex I know, I'm not holding my breath)I've been looking for something like this for some time now and haven't been able to find anything via google
I am running Debian Squeeze on my net book ( ASUS 1000PE ) with an Atheros wireless nic. It has been running fine for months automatically connecting during boot to my hidden network but all of a sudden no dice.
If I use the Gnome network manager and "connect to a hidden network" and I am all set but when I am at the command prompt ( which is how I have it set to boot to) it is a few more steps. How can I get it to automatically load. I did not have any scripts set up before so I assume it is a service I need to turn back on that was turned off in error.
I wrote this script in attempt to set-up automatic file fetch from the server using SSH; I want to collect *.pdf files and would like this to happened automatically. However, when I run below script I keep getting prompted for a password, how to include password in the script and how to export list of transferred files into the log file in txt format
scp root@192.168.1.1:/var/www/html/Apps/*.pdf /media/DataBackup/Linux/imported/ &>/home/denis/Logs/remotefilefetch.sh.out
This script works to a point, however I am prompted for a password and log file is created but remains empty.
Further to this LQ thread which Tinkster solved by suggesting the last command (thanks Tinkster) I have been exploring last -x reboot and have found that the reported duration is incorrect for the last reboot and shutdown when a old wtmp file is used. Not having a record for the following shutdown, last assumes that the system has been up until the current time and similarly for the shutdown.
The output comes in time order, latest first, each line showing the time of the reboot and the uptime from then to shutdown. Using last -x reboot shutdown to show the shutdown time, here's an illustration
Code:
shutdown system down 2.6.29.6-smp Sun Mar 7 15:35 - 03:02 (11:27)
reboot system boot 2.6.29.6-smp Sun Mar 7 09:35 (05:59)
09:35 until 15:35 is 05:59.
When the uptime exceeds 24 hours it is shown as (<days>+<hours:minutes) like this
Code:
shutdown system down 2.6.29.6-smp Sun Feb 21 12:39 - 13:20 (00:40)
reboot system boot 2.6.29.6-smp Sat Feb 20 09:39 (1+02:59)
09:39 until 12:39 the next day is 1 day 02:59.
The time in parentheses at the end of the shutdown lines is normally the time until the next shutdown.
So far so good. The incorrect output is for the last reboot and shutdown of an old wtmp file. Here's the output of last /var/log/wtmp -x reboot shutdown; last -f /var/log/wtmp.1 -x reboot shutdown
Code:
[snip]
reboot system boot 2.6.29.6-smp Fri Mar 12 07:42 (01:54)
shutdown system down 2.6.29.6-smp Fri Mar 12 01:31 - 09:37 (08:05)
wtmp begins Thu Mar 11 08:25:26 2010
[snip]
reboot system boot 2.6.29.6-smp Wed Mar 10 14:12 (15+01:42)
shutdown system down 2.6.29.6-smp Wed Mar 10 12:41 - 15:54 (15+03:13)
[snip]
The boot started at "Wed Mar 10 14:12" which had an actual uptime of 1 day 11:20 is reported as 15 days 03:13 which is the time from then until the last -f /var/log/wtmp.1 -x reboot shutdown command was issued. The time from shutdown to shutdown is similarly affected.
How may I normalize a (voice) audio mp3 or aac file with no loss, having the gain rised as much as possible (mitigating distortion using a compressor), so in a long conversation people that speak softer can have more gain for their voice and people that speak louder can have less gain?
View 1 Replies View RelatedI'm using Ubuntu 10.04 and I have a 1TB NTFS (internal) hard drive where I put all my files. The drive shows up in the "Places" menu, and if I select & open it, the drive and all the scripts & text files in it work. But, if I go to run the scripts without opening the dive in the places menu first, it just gives an error.
1. What is being done when I select the drive in the places menu?
2. Can this be set up automatically, so I don't have to open the drive every time after I start up?
all the sudden i have to start typing in the nm keyring password and subsequently all my website logins
View 1 Replies View RelatedI have 389 fedora Directory Server which is nothing but LDAP Server running on 389 Server.Its working fine on CentOS. Now I am in search of script which can be put on boot time so that the new Machine can automatically come under LDAP Client.Generally the machines are RHEL 4/5.
View 6 Replies View RelatedI am using Ubuntu 9.04. Years ago, I did UNIX and DOS line commands, but I am 66 and dim, though my doctor says he still thinks I have my marble.Anyway, my Linux shuts down automatically faster than I want it to.How does one control this?
View 3 Replies View RelatedWhen I go into the manage user and group application the check box to automatically log in is not available.
View 2 Replies View RelatedI've installed Slackware 12.2 on a 12 year old desktop. It is the only OS on the machine. When I press the Power button it stops at Slackware's splash screen asking me to choose an OS, even tho' there is only one to choose from. I installed LILO to the MBR and that is also listed there as a possibility.
Is there a way to set Linux so it will simply load automatically?
Ubuntu restarts every 1 hour and sometimes around 3 am in the morning. It is happening for the past few weeks i didn't find any help for this problem in the net. Please reply if there is any way to find why it is happening or how to stop if from doing an auto reboot
View 3 Replies View RelatedMy Ubuntu laptop gets docked into a few different locations per day with different hardware and use cases. I'd like to automate the preference settings for each of these locations:
Work computer, dual head 1280x1024
External USB audio and bluetooth audio
Home computer, dual head 1280x1024, 1080p
External USB audio
Basically, when I dock the box in either (1) or (2), I want to automagically get the right xrandr settings for the different screen geometries and the right audio routing.
What scripts, etc. are responsible for the inscrutable default behavior?
Are there packages for customizing this?
If I wanted to roll my own, what is the right library to use to catch the hotplug events?
I have a cluster of 50 machines and some machines already have ssh automatic login setup but I want to be able to check this with a script.
View 1 Replies View RelatedWhat should I have to do if I want to back again to the previous conf of automatic Conversion to Daylight saving. Also I noted that the o/p of the zdump -v /usr/share/zoneinfo/Africa/Cairo | grep 2011 was
/usr/share/zoneinfo/Africa/Cairo Thu Apr 28 21:59:59 2011 UTC = Thu Apr 28 23:59:59 2011 EET isdst=0 gmtoff=7200
/usr/share/zoneinfo/Africa/Cairo Thu Apr 28 22:00:00 2011 UTC = Fri Apr 29 01:00:00 2011 EEST isdst=1 gmtoff=10800
/usr/share/zoneinfo/Africa/Cairo Sat Aug 20 20:59:59 2011 UTC = Sat Aug 20 23:59:59 2011 EEST isdst=1 gmtoff=10800
/usr/share/zoneinfo/Africa/Cairo Sat Aug 20 21:00:00 2011 UTC = Sat Aug 20 23:00:00 2011 EET isdst=0 gmtoff=7200
and changed to be
/usr/share/zoneinfo/Africa/Cairo -9223372036854689408 = NULL
/usr/share/zoneinfo/Africa/Cairo 9223372036854689407 = NULL
/usr/share/zoneinfo/Africa/Cairo 9223372036854775807 = NULL
After adding the new rule
Note : these are the I made to disable auto conversion to daylight saving. I created a text file named nodst at usr/share/zoneinfo/Africa
Then type the following:
#Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S
Rule egypt 2011 2013 - Apr 29 00:00 0 s
# Zone NAME GMTOFF RULES/SAVE FORMAT [UNTIL]
Zone Africa/Cairo +2:00 egypt BRE%s
Then issue the following command
zic nodst
ln -sf /usr/share/zoneinfo/Africa/Cairo /etc/localtime
I'm a big fan of the NSLU2-Linux project so I've been doing some developments for this platform for the last three years. In order for the end users to test my applications, I initially created an USB image with everything bundled into it. Then, they only had to download the image and decompress (dd) it into an USB pendrive with capacity equal or greater than 4 GB. The fact is that this has brought me lots of problems in the practice since my Web server hardly accepts long file transfers.
Moreover, flash spaces beyond 4GB are wasted. As result, I'm now considering a different approach as I don't know how to do it. Well, I've thought that I could maybe create an USB disk image only with the root file system partition. Then, the first time a script runs, it creates a home partition and formats it into the rest of the space available in the pendrive. There is maybe some command-line alternative to fdisk without having the user to interact during the format process... ??