Shutdown from within X

I haven't been able to phrase this for google, so I'm humbly asking for human assistance --maybe yours.
I'd like to be able to shutdown/halt/poweroff my system by issuing a command while I still have applications running in an X server. If I call 'poweroff', X shuts down immediately without leaving time for its clients to shut down tidily.
I'd like to do something like this:
* Send SIGTERM to processes running inside X. Wait a while, then send SIGKILL
* Issue the 'poweroff' command.
I could put that in my ~/.xinitrc file:
xbindkeys
pekwm
# kill processes here
poweroff
I have a few questions though:
1. Is there a simpler/better method?
2. How do I find out which processes are running, which ones I own, and which ones correspond to X clients?
3. Is SIGTERM the right signal to send?
Edit: sorry for early posting. Where Google fails, man often succeeds. I'm in the middle of reading 'man proc'.
Last edited by peets (2008-01-05 04:32:33)

peets wrote:
I haven't been able to phrase this for google, so I'm humbly asking for human assistance --maybe yours.
I'd like to be able to shutdown/halt/poweroff my system by issuing a command while I still have applications running in an X server. If I call 'poweroff', X shuts down immediately without leaving time for its clients to shut down tidily.
I'd like to do something like this:
* Send SIGTERM to processes running inside X. Wait a while, then send SIGKILL
* Issue the 'poweroff' command.
I could put that in my ~/.xinitrc file:
xbindkeys
pekwm
# kill processes here
poweroff
I have a few questions though:
1. Is there a simpler/better method?
2. How do I find out which processes are running, which ones I own, and which ones correspond to X clients?
3. Is SIGTERM the right signal to send?
Edit: sorry for early posting. Where Google fails, man often succeeds. I'm in the middle of reading 'man proc'.
as root, Issue the 'halt' command. That does a clean shutdown.

Similar Messages

  • How do I shutdown from within Genome??

    How do I shutdown from within Genome??
    There is only a logout option - and that do not work.
    If I open a terminal and enter init 5 nothing happens.
    Or so it seems some services maybe stop.
    BUT there is no logoff and shutdown of Genome. So I swicth
    off my pc and next time I boot up my file system was corrupted.
    FSCK did not work I end up install everything this time use bypass
    option and install the patches for PC-Solaris 8.
    How do I go to a command line environment within Genome
    a .dtconfig stop ?? Will this let Genome come down without
    booting up and loosing my system again??

    ok... i figured it out... a 'Sprite' is really also a DisplayObjectContainer... so if i make my class an extension of Sprite i can 'addChild' to the Sprite and then add them all to the stage at once by adding Sprite to the stage...

  • Scripting question: Is there a difference between shutdown from within the VM and using the WMIService InitiateShutdown

    Hi,
    Are there any problems with shutting down a virtual machine using a script?  (example of shutdown script here). 
    In this case, I want to start VM's in a particular sequence and timing, and then reverse the sequence and timing for shutdown.  The built-in settings of hyper-V haven't been adequate.
    Is the command "ShutdownList.ItemIndex(0).InitiateShutdown(True,"script
    shutdown")" the same thing as initiating a GUI activated shutdown process?
    If not, does commanding a shutdown from the host using a script cause
    any system problems inside the VM?  If so, are there other or better ways to accomplish this?
    Thanks.
    Best Regards,
    Alan

    Hi Alan,
    I would like to check if you need further assistance .
    Best Regards
    Elton Ji
    We
    are trying to better understand customer views on social support experience, so your participation in this
    interview project would be greatly appreciated if you have time.
    Thanks for helping make community forums a great place.

  • [SOLVED] How do I shutdown from SLIM ?

    I am using SLIM to login to Fluxbox.  I should be able to type halt as username from within SLIM to shutdown.  Typing halt as username does not shutdown.  I have set sudo to allow my user to shutdown, but that doesn't help.
    How do I enable shutdown from within SLIM?
    Thank you
    Last edited by glenn69 (2012-04-26 17:49:01)

    glenn69 wrote:I am using SLIM to login to Fluxbox.  I should be able to type halt as username from within SLIM to shutdown.  Typing halt as username does not shutdown.  I have set sudo to allow my user to shutdown, but that doesn't help.
    Does it work with root password?

  • I cannot ping any VIP from within the ACE or from rservers

    I cannot ping any VIP from within the ACE or from rservers.  Is this expected?  I have rservers in other serverfarms that need to be able to communicate with the VIP of other serverfarms.  Any help is greatly appreciated.

    Thanks for you reply.  here is the config.  I removed other rserver and serverfarm config that does not have to do with this issue.
    logging enable
    logging fastpath
    logging standby
    logging console 4
    logging timestamp
    logging trap 4
    logging history 4
    logging buffered 4
    logging persistent 4
    logging monitor 4
    logging device-id hostname
    logging host 172.26.254.185 udp/514
    logging host 172.26.221.25 udp/514
    access-list INBOUND line 8 extended permit ip any any
    access-list INBOUND line 16 extended permit icmp any any
    access-list INBOUND line 24 extended permit tcp any any
    access-list INBOUND line 32 extended permit udp any any
    access-list ORADB line 8 extended permit tcp any any
    probe http CITRIX
      interval 30
      passdetect interval 15
      passdetect count 6
      open 1
    probe tcp HYPERION
      port 19000
      interval 2
      faildetect 2
      passdetect interval 2
      passdetect count 2
      receive 2
      open 1
    probe icmp PROBE_SERVICE_ICMP
      interval 5
      passdetect interval 5
    probe tcp W15SPSWFET001_PROBE
      interval 5
      passdetect interval 5
      connection term forced
      open 1
    parameter-map type connection TIMEOUT
      set timeout inactivity 43200
    parameter-map type http test
      persistence-rebalance
      set header-maxparse-length 2006
    rserver host w0bairwatch003
      description MDM-SEG
      ip address 172.20.60.73
      inservice
    rserver host w0bairwatch004
      description MDM-SEG
      ip address 172.20.60.74
      inservice
    rserver host w0bairwatch005
      description MDM-DEVICE
      ip address 172.20.60.75
      inservice
    rserver host w0bairwatch006
      description MDM-DEVICE
      ip address 172.20.60.76
      inservice
    rserver host w0bhamobile001
      description Lotus Notes Traveler Server
      ip address 172.20.60.57
      inservice
    rserver host w0bhamobile002
      description Lotus Notes Traveler Server
      ip address 172.20.60.58
      inservice
    serverfarm host MDMDEVICE
      predictor leastconns
      probe PROBE_SERVICE_ICMP
      rserver w0bairwatch005
        inservice
      rserver w0bairwatch006
    serverfarm host MDMSEG
      predictor leastconns
      probe PROBE_SERVICE_ICMP
      rserver w0bairwatch003
        inservice
      rserver w0bairwatch004
        inservice
    serverfarm host TRAVLR
      predictor leastconns
      probe PROBE_SERVICE_ICMP
      rserver w0bhamobile001
        inservice
      rserver w0bhamobile002
        inservice
    class-map match-all MDMDEVICE-VIP
      2 match virtual-address 172.20.48.35 any
    class-map match-all MDMSEG-VIP
      2 match virtual-address 172.20.48.33 any
    class-map type management match-any REMOTE_ACCESS
      description Remote access traffic match
      201 match protocol ssh any
      202 match protocol telnet any
      203 match protocol icmp any
      204 match protocol https any
      205 match protocol http any
      206 match protocol xml-https any
      207 match protocol snmp any
    class-map match-all TRAVLR-VIP
      2 match virtual-address 172.20.48.34 any
    policy-map type management first-match REMOTE_MGMT_ALLOW_POLICY
      class REMOTE_ACCESS
        permit
    policy-map type loadbalance first-match MDMDEVICE
      class class-default
        serverfarm MDMDEVICE
    policy-map type loadbalance first-match MDMSEG
      class class-default
        serverfarm MDMSEG
    policy-map type loadbalance first-match TRAVLR
      class class-default
        serverfarm TRAVLR
    policy-map multi-match CLIENTS-VIPS
      class MDMDEVICE-VIP
        loadbalance vip inservice
        loadbalance policy MDMDEVICE
        loadbalance vip icmp-reply active
      class MDMSEG-VIP
        loadbalance vip inservice
        loadbalance policy MDMSEG
        loadbalance vip icmp-reply active
      class TRAVLR-VIP
        loadbalance vip inservice
        loadbalance policy TRAVLR
        loadbalance vip icmp-reply active
    interface vlan 48
      ip address 172.20.48.10 255.255.255.0
      access-group input INBOUND
      access-group output INBOUND
      service-policy input REMOTE_MGMT_ALLOW_POLICY
      service-policy input CLIENTS-VIPS
      no shutdown
    interface vlan 60
      ip address 172.20.60.10 255.255.255.0
      access-group input INBOUND
      access-group output INBOUND
      service-policy input REMOTE_MGMT_ALLOW_POLICY
      no shutdown
    ip route 0.0.0.0 0.0.0.0 172.20.48.1

  • Cannot send email from within iPhoto

    Using OX X 10.7.5 cannot send email from within iPhoto.  I get this error message: "Your email did not go through because the server did not reply."
    If I change the preference to use email, everything goes fine but I lose the formatting feature.

    iPhoto Menu ->
    Preferences ->
    Accounts ->
    Delete and recreate your email settings.
    Alternatively, use Apple's Mail for the job. It has Templates too - and more of them. Check out the Stationery...

  • How can I execute an external program from within a button's event handler?

    I am using Tomcat ApacheTomcat 6.0.16 with Netbeans 6.1 (with the latest JDK/J2EE)
    I need to execute external programs from an event handler for a button on a JSF page (the program is compiled, and extremely fast compared both to plain java and especially stored procedures written in SQL).
    I tried what I'd do in a standalone program (as shown in the appended code), but it didn't work. Instead I received text saying the program couldn't be found. This error message comes even if I try the Windows command "dir". I thought with 'dir' I'd at least get the contents of the current working directory. :-(
    I can probably get by with cgi on Apache's httpd server (or, I understand tomcat supports cgi, but I have yet to get that to work either), but whatever I do I need to be able to do it from within the button's event handler. And if I resort to cgi, I must be able to maintain session jumping from one server to the other and back.
    So, then, how can I do this?
    Thanks
    Ted
    NB: The programs that I need to run do NOT take input from the user. Rather, my code in the web application processes user selections from selection controls, and a couple field controls, sanitizes the inoputs and places clean, safe data in a MySQL database, and then the external program I need to run gets safe data from the database, does some heavy duty number crunching, and puts the output data into the database. They are well insulated from mischeif.
    NB: In the following array_function_test.pl was placed in the same folder as the web application's jsp pages, (and I'd tried WEB-INF - with the same result), and I DID see the file in the application's war file.
            try {
                java.lang.ProcessBuilder pn = new java.lang.ProcessBuilder("array_function_test.pl");
                //pn.directory(new java.io.File("K:\\work"));
                java.lang.Process pr = pn.start();
                java.io.BufferedInputStream bis = (java.io.BufferedInputStream)pr.getInputStream();
                String tmp = new String("");
                byte b[] = new byte[1000];
                int i = 0;
                while (i != -1) {
                    bis.read(b);
                    tmp += new String(b);
                getSelectionsDisplayTextArea().setText(getSelectionsDisplayTextArea().getText() + "\n\n" + tmp);
            } catch (java.io.IOException ex) {
                getSelectionsDisplayTextArea().setText(getSelectionsDisplayTextArea().getText() + "\n\n" + ex.getMessage());
            }

    Hi Fonsi!
    One way to execute an external program is to use the System Exec.vi. You find it in the functions pallet under Communication.
    /Thomas

  • Email from within iPhoto '08 (7.1.1) quit working

    I am running Leopard (10.5.1) and iPhoto '08 (7.1.1) on a 2.4ghz 17" MBP. Whenever I try to email a photo from within iPhoto it pops up a window to let me choose size & options, I hit the Compose button, it will then popup a window saying that it is Preparing photos for email... then that window just goes away and it never creates the new email. I see this same behavior regardless of whether or not Mail is already open and regardless of what photo I am trying to email. This was working fine in the past... believe that it quit working after the upgrade to 10.5.1 (but not absolutely positive of that)... Any troubleshooting ideas would be greatly appreciated as I use this feature quite often.
    Cheers!
    Kirk

    Kirk:
    Try deleting the iPhoto preference file, com.apple.iPhoto.plist, that resides in your User/Library/Preferences folder. Next, if needed, download and run BatChmod on the iPhoto Library folder with the settings shown here, putting your administrator login name, long or short, in the owner and group sections. You can either type in the path to the folder or just drag the folder into that field.
    Do you Twango?
    TIP: For insurance against the iPhoto database corruption that many users have experienced I recommend making a backup copy of the Library6.iPhoto database file and keep it current. If problems crop up where iPhoto suddenly can't see any photos or thinks there are no photos in the library, replacing the working Library6.iPhoto file with the backup will often get the library back. By keeping it current I mean backup after each import and/or any serious editing or work on books, slideshows, calendars, cards, etc. That insures that if a problem pops up and you do need to replace the database file, you'll retain all those efforts. It doesn't take long to make the backup and it's good insurance.
    I've created an Automator workflow application (requires Tiger), iPhoto dB File Backup, that will copy the selected Library6.iPhoto file from your iPhoto Library folder to the Pictures folder, replacing any previous version of it. It's compatible with iPhoto 08 libraries and Leopard. iPhoto does not have to be closed to run the application, just idle. You can download it at Toad's Cellar. Be sure to read the Read Me pdf file.

  • Send email from within apex 2.1 application

    Hello,
    I like to send email from within apex application. I use oracle 10g xe with apex 2.1
    thx for advice
    Edited by: wucis on Feb 27, 2012 11:49 AM

    That is a very old version indeed. The documentation for sending emails from Apex 2.2 is here:
    http://docs.oracle.com/cd/B31036_01/doc/appdev.22/b28550/advnc.htm#BABJHJJF

  • I cannot email photos from within iPhoto (v. 9.5.1). When I hit send I get a message: "Your email did not go through because the server did not reply." This happens for both my iCloud account and my Shaw account. What to do???

    I cannot email photos from within iPhoto (v. 9.5.1). When I hit send I get a message: "Your email did not go through because the server did not reply." This happens for both my iCloud account and my Shaw account. What to do???

    Are you able to email from Mail with those two accounts?  If so:
    1 - go to iPhoto's Accounts preference pane and delete both accounts. Now add them back and try again.
    2 - a better solution IMO is to set Mail as the email client for iPhoto is iPhoto's General preference pane.  This gives you better access to your contacts, a sent copy of all emails and, if you want a layout similar to iPhoto's, photo layouts located in Mail's stationary.

  • Just upgraded to Lion an am discovering that I cannot send email photos from within iPhoto. Error message says bad Internet connection or server not working, when that's not the case. Never happened in Snow Leopard! Help!!!

    Just upgraded to Lion an am discovering that I cannot send email photos from within iPhoto. Error message says bad Internet connection or server not working, when that's not the case. Never happened in Snow Leopard! Help!!!

    what email service - Yahoo mail have been acting up lately
    you can try setting Mail as your email client - it resolves this pfoblem for some people
    LN

  • Cannot send an email from within contacts on iPhone

    I’m trying to send email from within my contacts list app on my iPhone but the send button will not highlight and therefore cannot be pressed to send the email.   Sending email from the mall app works fine. Anyone know why this is happening?

    That also occurs for me and looks like a bug. The problem seems to be that, although the "To" address appears in the draft email, the iPhone does not think that it is there and won't activate the Send button. If one simply touches the "To" field the address disappears.
    Submit this as a bug at http://www.apple.com/feedback/iphone.html

  • IMac will only restart or shutdown from power button.

    My iMac will only restart or shutdown from the power button, it also will not logoff users. It starts ok, but only after a hard reboot?? I have repaired permisions and no change. I have a clone I can restore from but any ideas whats up here?
    The only things that I know I have altered are deleting files saved during migration from Panther (months ago)and running Unbuntu Live CD.
    iMac G4 15 Mac OS X (10.4.7) 728ram

    Are you booting into Ubuntu Linux? Most of us here wouldn't now anything to do with it. If the problem is occurring when booted into Mac OS X, it may be a sign of data corruption in the power management and user settings. Some corruption is easy to repair such as fixing the directory (which I'd only do after a clone). Here's how according to my FAQ:
    http://www.macmaps.com/directoryfaq.html
    And I assume the issue is with your iMac G4.

  • Oracle Forms 11gR2 - Cannot deploy locally from within Forms

    I cannot deploy locally from within forms.  The server is up and running and I can deploy the form by putting the correct URL in the address line of the browser window.  When I try to deploy from within forms it comes up with some crazy URL that differs everytime.
    This is what the URL should be and this works from the browser:
    http://machinename:7002/forms/frmservlet?form=WRD608ADMIN_11g.fmx&userid=&otherparams=useSDI=yes
    Here is one of the URLs it came up with when I try to run it from within Forms:
    http://localhost:60231/lysVL2VjqT33znjfvLwanktVRxTIc6dEwVeRNXXRmhYU2qjf
    Localhost is always there, but the rest varies.
    In Forms, I have the Preferences, Runtime set to:
    http://machinename:7002/forms/frmservlet
    Where machine name is my PC, it is the same for this address as the URL above that works directly from the browser.
    So what am I missing?
    Thank you in advance.

    Generally speaking, it is discouraged to manually edit any of the configuration files if they are managed by WLS Console or EM.  In this case, default.env is managed by EM.  Therefore, changes to the file should be done through EM.  If however, you want to alter the file manually, the following is likely the best way to accomplish this:
    1.  Stop the WLS Admin Server and Node Manager
    2.  Locate the proper file you wish to edit.  By proper I mean, there are several copies of most config files.  Most of the config files found in the Oracle Home are actually template files and are not used at runtime.  Altering these will not give you the change you want.  The default.env you want would be here (assuming Windows)
    C:\Oracle\Middleware\user_projects\domains\ClassicDomain\config\fmwconfig\servers\WLS_FORMS\applications\formsapp_11.1.2\config
    If you are using a "Development" installation type, the above path will reflect AdminServer instead of WLS_FORMS.  Remember that Development installations are not for multi-user purposes.  Production deployments require the "Deployment" installation type, which can also include the Builders.
    Do NOT make any changes yet.
    3.  Once you find the correct file, create a backup copy.  Then open the file for edit (not the backup).
    4.  Make the desired changes and save.
    5.  Restart Node Manager and Admin Server if you plan to use them.
    For more information about using EM to manage your configuration, refer to the product documentation:
    http://docs.oracle.com/cd/E38115_01/doc.111210/e24477/configure.htm#CHDCCGHI

  • Opening an https connection from within a Servlet.

    I am having problems trying to establish an HTTPS connection to a servlet from within a different servlet.
    I get the java.net.MalformedURLException: unknown protocol: https. SSL is setup for the web server. Direct connections from the browser to a servlet work fine with SSL, but a connection from one servlet to another servlet fails. I'm stumped. Is there a separate SSL install/configuration required for the servlet engine? Could anyone explain?

    When you set up SSL enabled web server, you should be getting a trust cert file that knows the hand shake protocol to talk to that server. Once you have that file, you can load that file from that servlet using System.load and then you would be able to talk to anything that runs on that SSL enabled Web server.
    Also you must have JSSE jar files installed in your system .
    Check out this url:
    http://java.sun.com/products/jsse/INSTALL.html
    Let me know if you still have problems

Maybe you are looking for

  • Pop up window saying Memory is too low to continue in Logic.Why?Way to Fix?

    I recently purchased my IMac OSX 10.6.3 as well as Logic. I have about a half dozen projects on my hard drive now, which is also being backed up to a "time machine" external drive. The projects are pretty small( just piano, or piano and string quarte

  • Final Cut Pro X Export Help...

    I have Final Cut Pro X 10.0.5 installed and I'm editing a video I made a while back; the RAW version I made was 700MB+ and the edited/exported version came out to 136MB (That I'm working on now) wants to be exorted as 441.4MB. I want to know how to g

  • Flexfield indexing, is that smart?

    We are using many customizations with flexfields. Unfortunately, many queries are based on those fields and according no index is present, full table scans are happening all the time (many of the tables has 2-8 mil. of records). Because these tables

  • CP8 'Runtime error!  R6025 - pure virtual function call (FIX)

    We just had this error appear while pressed to finish a customers job. All hell broke loose there was a lot of wailing and gnashing of teeth. Then our cool calm and collected IT dude Chris stepped in and tracked the problem down to this. 1. Reinstall

  • Load Hierarchies to Z CostElement InfoObject

    Hi, I have to load Hierarchies to a newly created Z CostElement (ZCOSTELEM) InfoObject. So I thought of using the same way how 0COSTELMNT is loaded. 0COSTELMNT is loaded using DataSource 0COSTELMNT_0102_HIER. When I tried to create Transfer Rule for