Ubuntu :: Execute A Script On X Shutdown?

Mar 27, 2010

I would like to be able to execute a script every time X is shut down (e.g., by Ctrl+Alt+Backspace), namely, logout. Is this possible? If it is, in what file do I put the command/script?

View 9 Replies


ADVERTISEMENT

Ubuntu :: Execute Tasks List Before Shutdown

Aug 10, 2010

When I shut down my computer I want to show some pending tasks that I have to do before leaving the office... I did a local application to manage those tasks, so basically I just want to run a command, and shut down after I kill the app executed. I have already tried with these options:

* /etc/gdm/PostSession/Default --> this works only when I select LogOut option instead Shutdown.

* /etc/rc0.d/K01mycustomscript --> execute script after X is killed

* $HOME/.bash_logout --> This looks like does nothing.

* ./app-to-run && sudo shutdown -h now --> Don't like it for 2 reasons, prompts for sudo password, and can't use my laptop shutdown button.

How could I modify Shutdown dialog ? should I recompile Gnome ? Options? I am using Ubuntu 10.04

View 5 Replies View Related

Ubuntu :: Execute Python Code Before Shutdown

Dec 2, 2010

I have written a backup script backing up the data I have worked during the day with rsync and sends me a log in my email. now it works perfect but i want to execute it each time i shutdown my computer in the evening not during reboot or logout.It seems that i can not run it by putting it in init.d and softlinking in rc0.d as K00backup. I think it is because script uses many services like python or smtplib, gnome-keyrings that in that time might have been already shutdown.

View 2 Replies View Related

Red Hat :: Shutdown - System Goes Down Before My Rc Script Execute

Apr 1, 2010

Tested on RedHat entreprise 5.5, 5.4, 5.3 I would like to stop my db (not oracle) when the system shutdown or reboot. I have wrote my script for init.d

Here is the head :

The problem is : shutdown -r stop the system before my K script execute. I have not my "blabla" in /tmp/mystop.log

In fact the scritp is for database startup and database shutdown manually it works I mean : /etc/init.d/mystop stop ; /etc/init.d/mystop start So I truncated the scritp until I only get echo "blabla"

This work idealy under HPUX, AIX, and I think I'm missing something "special" for Redhat. I'm quite sure it was ok with redhat 8 and ES 3.0.

View 10 Replies View Related

CentOS 5 :: Where To Put Commands To Execute Just Before Shutdown / Logoff?

Mar 3, 2010

Where can I put commands which should be executed just before

- logoff

- shutdown

I think there must be somewhere an opposite script to

.initrc
or
.bashrc

View 5 Replies View Related

Server :: Shutdown The Nodes From The Master Terminal Using "shutdown -h Now" Get Shutdown?

Dec 10, 2010

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 ?

View 1 Replies View Related

CentOS 5 :: Can't Execute Things In /tmp Now But Is There A Way To Execute Only One File And No More?

Feb 17, 2011

i created a /tmp partition amd mounted it like this:" mount -o loop,noexec,nosuid,rw /usr/tmpDSK /tmp"
I know i can't execute things in /tmp now but is there a way to execute only one file and no more???

View 1 Replies View Related

Ubuntu :: Monitor Out Of Sync During Boot And Shutdown (also Shutdown Hang)?

Jun 30, 2010

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 Related

Fedora :: Shutdown Policy Triggered By Vncserver - Computer Refuses To Shutdown Normally

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

Ubuntu :: Can't Shutdown Without Running Sudo Shutdown

Jun 20, 2010

I cant shutdown without running sudo shutdown. When I try to use the default gnome shut down it takes me back to the logon screen. Fresh install today and I've had the same problem on other installs.

View 9 Replies View Related

Ubuntu :: Randomly Pop Up The Shutdown Menu And Then Shutdown?

Sep 7, 2010

Ubuntu will randomly pop up the shutdown menu and then shutdown.It seems to happen when im in firefox and typing and it has been difficult to replicate. I dont think it is a temp issue since watch sensors shows temmp of 40-50C. Someimtes it happens every minute someimtes i can go 10min without it happening.

Dell Inspiron 1525
ubuntu 10.04 (only os on system)

View 3 Replies View Related

Ubuntu :: Shutdown Command Like Shutdown Button?

Dec 10, 2010

looking for a command that shutdown/reboot my ubuntu just same as process that happened when I press shutdown buttonIn fact I need to close all programs that are running and then PC shutdown (that happened when I press shutdown button).

View 9 Replies View Related

General :: Locate Shutdown Log For Linux Shutdown (RHL 5.1-2.6.18-53.el5PAE)

Apr 22, 2010

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.

View 2 Replies View Related

SUSE :: Automate Execute Command, Reboot And Execute Command?

Dec 1, 2008

Is there a way to execute some command and then after the command completes utomatically reboot the system and then after the system reboots execute another command ? For example look at the sequence shown below(1) Execute command-1(2) After the command-1 in (1) is completed,reboot the system (3) Execute command-2(4) After execution of command-2 reboot the sytemIs there a way i can automate this process so that i need not reboot the system manually

View 5 Replies View Related

OpenSUSE Install :: OpenSUSE 11.4 Delayed Shutdown While Pressing The Shutdown Button?

Mar 12, 2011

I did a live upgrade from 11.3 KDE and observe a following issue.When I press the shutdown button on the laptop it initiates the shutdown and shuts down fine but after a significant delay of time (something like 30 seconds). When I click the shutdown button in KDE it initiates the shutdown instantly. This was not the case in 11.3 where the shutdown worked the same regardless of the method that triggered it

View 6 Replies View Related

Server :: Unable To Shutdown/reboot Server, No Shutdown Process Running?

Mar 30, 2010

I'm trying to reboot the server (shutdown -r now).But it seems like nothing happened.

When I try "shutdown -c", the system prompts "shutdown: cannot find pid of running shutdown."

View 5 Replies View Related

General :: [FYI] "last -f <old Wtmp> -x Reboot Shutdown" Incorrect For Last Reboot And Shutdown?

Mar 25, 2010

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.

View 1 Replies View Related

Ubuntu :: "shutdown" In Terminal Vs "shutdown" In Desktop

Feb 26, 2010

I'm new to Ubuntu and have spent several days trying to make a few simple alterations to my Myth 9.10 installation. My biggest task was to get the MCE "power" and "start" buttons working, which they now are - sort of.

The problem is with the shutdown command that the power button activates seems to be different to the shutdown command from the taskbar shutdown menu i.e. when I switch off the computer with the remote it restarts with the "recovery" menu as it wasn't shutdown properly. Same thing happens with the shutdown command from a terminal window. Shutting off from the desktop menu is fine.

View 9 Replies View Related

Programming :: Awk - Input From One Line - Execute Program - Input From Next Line - Execute Program

Sep 25, 2010

I have a file with two fields of numbers that I want to use as input for another program.

Code:

The above code does not work, as I think it would take the whole first and second fields as the input for one particular instance of the program 'inputbashangle'. What I want is to get the first two numbers from the first line of the file 'outfailtest', execute 'inputbashangle' with them, then move on to the first two numbers of the second line for all the lines of 'outfailtest'.

View 9 Replies View Related

Ubuntu :: Possible To Execute Program From RAM

Feb 14, 2010

I was wondering if it was possible to execute a program from RAM, like having the file data in a bash script variable and then running it.
Something like this:
ls=`cat ls`
$ls
So is it possible to run a program without touching the hard disk and without creating tmpfs or ramfs (it would need to be standard user privileges).

View 1 Replies View Related

Ubuntu :: Why Can't Execute These Files

May 4, 2010

I'm having trouble printing with CUPS. Turns out that none of the binaries under /opt/OpenPrinting-Gutenprint can be executed. Witness:

root$ cd /opt/OpenPrinting-Gutenprint/bin
root$ ./cups-calibrate
bash: ./cups-calibrate: Permission denied

[code]...

View 7 Replies View Related

Ubuntu :: How To Execute A .bin File

May 18, 2010

execute a .bin file. I have downloaded an application but I cannot run it (not recognized by double click).

View 7 Replies View Related

Ubuntu :: Can't Execute Script From Cd

Oct 20, 2010

I have written a shell script and set the permissions to executable. It works fine. I burn it to a cd. But then, I cannot run it from the cd. All of the execute permissions are gone.

View 1 Replies View Related

Ubuntu :: Files Won't Execute?

Nov 20, 2010

I am having trouble getting files to execute, even though I used chmod 777 on them, I don't know what I did wrong, I use ubuntu server so only the terminal is available to me.

View 7 Replies View Related

Ubuntu :: Can't Execute .jar Files?

Apr 1, 2011

I'm trying to execute a .jar file(SwingTest.jar). I change the directory to where the .jar is(Desktop). Then type the following EXACTLY:java -jar SwingTest.jarBut all it outputs is:Failed to load Main-Class manifest attribute fromSwingTest.jar

View 7 Replies View Related

Ubuntu :: Accidentally Set All Bin To Execute?

May 20, 2011

I was in the wrong directory when I did a chmod +x *.bin, so now all of my commands in the terminal come back with the error "Cannot execute binary file." From ls, to cd .. I get this error. I seem to be able to do things with sudo, but does anyone know how to fix all of my permissions so that basic terminal commands come back?

View 9 Replies View Related

Ubuntu :: Execute From FAT Filesystem?

Jul 29, 2011

I have a collection of ELF executables that I am trying to run from a FAT filesystem. How can I do this without modifying the OS?p.s. I am running 11.04

View 3 Replies View Related

Ubuntu :: Execute The Apt-get Update

Sep 1, 2011

When trying to execute the apt-get update i got the following error

[Code]...

View 1 Replies View Related

General :: Can't Execute Binary On Ubuntu

Feb 11, 2010

Trying to setup a new Ubuntu machine and just downloaded 'p4' (Perforce command line client). It's a single file download - a statically-linked binary executable, so I just did:

wget [URL]

...right into /usr/bin. Simple enough. Except:
root@aj-ubuntu:/usr/bin# ll p4
-rwxr-xr-x 1 root root 748808 2010-02-11 16:54 p4
root@aj-ubuntu:/usr/bin# ./p4

[Code].....

View 6 Replies View Related

Ubuntu :: Execute Perl On Server?

Jan 7, 2010

what is wrong i have a web server setup and working fine running a web store in php i have added a search engine for the web the easiest setup programme is with an extension .pl when i try and execute this it asks me if i want to download it or open it i had this problem with the php script which a reboot sorted out so i have tried rebooting but get the same problem does anybody know how i can get it to execute on my server?

View 2 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved