How do I restart X from the console or from bash script?

I have searched with google, but can't find any answers not involving gdm or xdm. I need this because I'm writing a simple script that compiles and installs dwm and then restarts x.
Thanks.

Ashren wrote:
lilsirecho, no it does nothing.
buttons, sudo kill 'pidof X' && startx did work with xdm enabled (I still had to login again, though). The reason I don't use respawn is that I don't like display managers. Is there any way to circumvent them and still have the respawn feature? I want to restart dwm without typing in anything, besides the name of my script.
Thanks..
Absolutely.
Relevant parts of /etc/inittab:
id:5:initdefault:
x:5:respawn:/bin/su buttons -l -c "/bin/bash --login -c startx >/dev/null 2>/home/buttons/.xsession-errors"
"buttons" is of course my login name, and I prefer to have my errors go to a logfile in my home directory, which many display managers do by default.  Or at least GDM.

Similar Messages

  • My kids desabled my mini ipad after several tries to log in.  My computer that I used to sincronize it doesn't work anymore and i can't connected to itunes.. How can i restart it without the actual computer that I used before??

    My kids desabled my mini ipad after several tries to log in.  My computer that I used to sincronize it doesn't work anymore and i can't connected to itunes.. How can i restart it without the actual computer that I used before??

    You can use any computer but your data will be lost if you have no backup.

  • I have a iPad air how do I restart or reboot the device please

    I have an iPad air how do I restart or reboot the device please?

    Restart the iPad by holding down on the sleep button until the red slider appears and then slide to shut off. To power up hold the sleep button until the Apple logo appears and let go of the button. 
    Reset the iPad by holding down on the sleep and home buttons at the same time for about 10-15 seconds until the Apple Logo appears - ignore the red slider if it appears on the screen - let go of the buttons. Let the iPad start up.

  • Stuck at gdm how do i drop back into the console?

    okay first off i'm ashamed to get stuck at this spot after spending a long time figuring out how to install/configure anything. long story short i got my system core installed, installed fluxbox, and then installed gdm. unfortunately now gdm loads and wont let me back into the console(even if i try the command ctrl+alt+backspace). why is that bad? because i forgot to add a normal user and gdm wont allow me to login with root.
    my question: how do i drop back to the console?

    If you are satisfied, you should change the topic to "[SOLVED] stuck at gdm how do i drop back into the console?" so the rest of us know you are happy :-)

  • How to call a subroutine from sap script

    hi friends,
    Can anybody tell me How to call a subroutine from sap script .
    thanks n regards .
    Mahesh

    hi..
    Calling ABAP Subroutines: PERFORM 
    You can use the PERFORM command to call an ABAP subroutine (form) from any program, subject to the normal ABAP runtime authorization checking. You can use such calls to subroutines for carrying out calculations, for obtaining data from the database that is needed at display or print time, for formatting data, and so on.
    PERFORM commands, like all control commands, are executed when a document is formatted for display or printing. Communication between a subroutine that you call and the document is by way of symbols whose values are set in the subroutine.
    The system does not execute the PERFORM command within SAPscript replace modules, such as TEXT_SYMBOL_REPLACE or TEXT_INCLUDE_REPLACE. The replace modules can only replace symbol values or resolve include texts, but not interpret SAPscript control commands.
    Syntax in a form window:
    /: PERFORM <form> IN PROGRAM <prog>
    /: USING &INVAR1&
    /: USING &INVAR2&
    /: CHANGING &OUTVAR1&
    /: CHANGING &OUTVAR2&
    /: ENDPERFORM
    INVAR1 and INVAR2 are variable symbols and may be of any of the four SAPscript symbol types.
    OUTVAR1 and OUTVAR2 are local text symbols and must therefore be character strings.
    The ABAP subroutine called via the command line stated above must be defined in the ABAP report prog as follows:
    FORM <form> TABLES IN_TAB STRUCTURE ITCSY
    OUT_TAB STRUCTURE ITCSY.
    ENDFORM.
    The values of the SAPscript symbols passed with /: USING... are now stored in the internal table IN_TAB . Note that the system passes the values as character string to the subroutine, since the field Feld VALUE in structure ITCSY has the domain TDSYMVALUE (CHAR 80). See the example below on how to access the variables.
    The internal table OUT_TAB contains names and values of the CHANGING parameters in the PERFORM statement. These parameters are local text symbols, that is, character fields. See the example below on how to return the variables within the subroutine.
    From within a SAPscript form, a subroutine GET_BARCODE in the ABAP program QCJPERFO is called. Then the simple barcode contained there (‘First page’, ‘Next page’, ‘Last page’) is printed as local variable symbol.
    Definition in the SAPscript form:
    /: PERFORM GET_BARCODE IN PROGRAM QCJPERFO
    /: USING &PAGE&
    /: USING &NEXTPAGE&
    /: CHANGING &BARCODE&
    /: ENDPERFORM
    / &BARCODE&
    Coding of the calling ABAP program:
    REPORT QCJPERFO.
    FORM GET_BARCODE TABLES IN_PAR STUCTURE ITCSY
    OUT_PAR STRUCTURE ITCSY.
    DATA: PAGNUM LIKE SY-TABIX, "page number
    NEXTPAGE LIKE SY-TABIX. "number of next page
    READ TABLE IN_PAR WITH KEY ‘PAGE’.
    CHECK SY-SUBRC = 0.
    PAGNUM = IN_PAR-VALUE.
    READ TABLE IN_PAR WITH KEY ‘NEXTPAGE’.
    CHECK SY-SUBRC = 0.
    NEXTPAGE = IN_PAR-VALUE.
    READ TABLE OUT_PAR WITH KEY ‘BARCODE’.
    CHECK SY-SUBRC = 0.
    IF PAGNUM = 1.
    OUT_PAR-VALUE = ‘|’. "First page
    ELSE.
    OUT_PAR-VALUE = ‘||’. "Next page
    ENDIF.
    IF NEXTPAGE = 0.
    OUT_PAR-VALUE+2 = ‘L’. "Flag: last page
    ENDIF.
    MODIFY OUT_PAR INDEX SY-TABIX.
    ENDFORM.
    regards,
    veeresh

  • Writing to mplayer's stdin from bash script.

    I was just fulling with some bash script in order to automate the listening of my favorite radio stations via mplayer and a bash script. Going through the mplayers manual I saw the option -slave.
    -slave
    This option switches on slave mode. This is intended for use of MPlayer as a backend to other programs. Instead of intercepting keyboard events, MPlayer will read simplistic command lines from its stdin. The section SLAVE MODE PROTOCOL explains the syntax.
    At first I thought "ok, easy". I made some tries like "mplayer -slave -quiet .... < /tmp/stdin &" and then something like "echo -e 'mute' > /tmp/stdin" but it wouldn't work.
    Is it possible to send a process to the background inside a bash script and then write to it's stdin?
    SLAVE MODE PROTOCOL
    If the -slave option is given, playback is controlled by a line-based protocol. Each line must contain one command otherwise one of the following tokens:
    Commands
    seek <value> [type=<0/:1/:2>]
    Seek to some place in the movie. Type 0 is a relative seek of +/:- <value> seconds. Type 1 seek to <value> % in the movie. Type 2 is a seek to an absolute position of <value> seconds.
    audio_delay <value>
    Adjust the audio delay of value seconds
    quit
    Quit MPlayer
    pause
    Pause/:unpause the playback
    grap_frames
    Somebody know ?
    pt_step <value> [force=<value>]
    Go to next/:previous entry in the playtree.
    pt_up_step <value> [force=<value>]
    Like pt_step but it jumps to next/:previous in the parent list.
    alt_src_step <value>
    When more than one source is available it selects the next/:previous one (only supported by asx playlist).
    sub_delay <value> [abs=<value>]
    Adjust the subtitles delay of +/:- <value> seconds or set it to <value> seconds when abs is non zero.
    osd [level=<value>]
    Toggle osd mode or set it to level when level > 0.
    volume <dir>
    Increase/:decrease volume
    [contrast|brightness|hue|saturation] <-100-100> [abs=<value>]
    Set/:Adjust video parameters.
    frame_drop [type=<value>]
    Toggle/:Set frame dropping mode.
    sub_visibility
    Toggle subtitle visibility.
    sub_pos <value>
    Adjust subtitles position.
    vo_fullscreen
    Switch to fullscreen mode.
    tv_step_channel <dir>
    Select next/:previous tv channel.
    tv_step_norm
    Change TV norm.
    tv_step_chanlist
    Change channel list.
    gui_[loadsubtitle|about|play|stop]

    FIFO's are awesome and can be (ab)used for a lot of cool stuff.
    I've written some applications that do just what you are trying to do ( http://github.com/trapd00r/rmcd and http://github.com/trapd00r/RPD ), if you need inspiration.
    As for the backgrounding - you want to make a 'daemon', to detach from the running shell. See man fork, man 3 setsid and man 3 wait / man 3 waitpid (or my daemonize() function).

  • How do I restart or start the TREX Queue Server ?

    Hi:
    In one of our environment, the TREX Queue server is unavailable. The service is down. I see it in the TREX Monitor (System Administration/System Configuration/Knowledge Management/Index Administration/TREX Monitor)
    How do i restart (start) the queue server again ? Where can I do that ?
    Thanks,
    Felipe Mendivil

    Felipe,
    Queue server can be restarted thru the TREX admin tool. Go to your Trex host and the trex installation directory and launch trexadmin.bat. You can see all your trex services there.
    restart also is possible.Is the problem only with your queue server or is http server also affected?
    Rgds

  • How to find a text in the Frame maker document via script?

    How to find a particular text in the Frame maker document via script?

    johnsyns wrote:
    Why it doesn't work for the other days? When i tried to change the days other than wednesday. it return nothing.
    Reason why Justin's code does not work for other days is date format mask DAY returns day blank padded to 9 characters which is the longest day name which, yes you guessed right, is WEDNESDAY. You either need to blank pad or use format modifier FM:
    SQL> select *
      2    from (SELECT TO_DATE(SYSDATE+ROWNUM, 'DD-MON-YY') dt
      3            FROM DUAL CONNECT BY ROWNUM <= 27)
      4  WHERE TO_CHAR(dt,'DAY') = 'TUESDAY'
      5  /
    no rows selected
    SQL> select *
      2    from (SELECT TO_DATE(SYSDATE+ROWNUM, 'DD-MON-YY') dt
      3            FROM DUAL CONNECT BY ROWNUM <= 27)
      4  WHERE TO_CHAR(dt,'DAY') = 'TUESDAY  '
      5  /
    DT
    07-APR-09
    14-APR-09
    21-APR-09
    28-APR-09
    SQL> select *
      2    from (SELECT TO_DATE(SYSDATE+ROWNUM, 'DD-MON-YY') dt
      3            FROM DUAL CONNECT BY ROWNUM <= 27)
      4  WHERE TO_CHAR(dt,'FMDAY') = 'TUESDAY'
      5  /
    DT
    07-APR-09
    14-APR-09
    21-APR-09
    28-APR-09
    SQL> SY.

  • How to send 2 variable value from bash script into java.class

    #!/bin/bash
      a=10
      b=20
       echo $a $b | java addition
    donehi there,
    currently i have a simple java coding ( a + b ). and i m trying to connect with bash script but this bash script coudln't Enter 2nd value (b=20) while i running for it. may i know how do i can Enter 2 value into it?
    output from terminal
    [seng@localhost java_class]$ bash addition.sh
    =======================================================================
    simulation 1
    Num_a       = 10
    Num_b       = 20
    Enter your Num_a : 10
    Enter your Num_b : Exception in thread "main" java.lang.NumberFormatException
       at java.lang.Integer.parseInt(java.lang.String, int, boolean) (/usr/lib/libgcj.so.6.0.0)
       at java.lang.Integer.parseInt(java.lang.String) (/usr/lib/libgcj.so.6.0.0)
       at filter_god.GOD(java.util.List, java.util.List, java.lang.String, java.lang.String, int) (Unknown Source)
       at filter_god.main(java.lang.String[]) (Unknown Source)
       at gnu.java.lang.MainThread.call_main() (/usr/lib/libgcj.so.6.0.0)
       at gnu.java.lang.MainThread.run() (/usr/lib/libgcj.so.6.0.0)
    =======================================================================

    That code will send both numbers on a single line in standard input to the java process. So if the process reads standard input, it will get a single line that has this in it: "10 20".
    I'm guessing you're sending that whole line to Integer.parseInt. But a valid number doesn't have a space in the middle.
    You should split up the line using String.split. Or use a StringTokenizer. Or a regular expression. Or you can use a java.util.Scanner. Or a java.io.StreamTokenizer. Or maybe some other stuff that has slipped my mind at the moment.

  • How to call java method from workflow script?

    Hi
    I have a requirement of updating field value 'Document Status' based on review/approve of content from Workflow and hence need to update the version number. For that I need to call my java method from workflow during submit of review/approve condition. Please let me know how to call java method from workflow?
    Is there any alternative better way to achive this requirement from workflow? Please suggest.
    Thanks,
    Sarang

    OK. So, I think we can all conclude that you don't need to call any Java method, can't we? And, that wfUpdateMetadata is the command that will update your metadata.
    Now, the question is what are its arguments. It has two - the first is the name of a custom metadata field to be updated (let's suppose that one field is called xMinorVersion, and the other xMajorVersion), the other is the new value, e.g. <$wfUpdateMetaData("xMinorVersion", "New value.")$>As for new value - do you insist on using strings? Since you want to increase the value, it would be more convenient to work with numbers. For instance, with integers you could go with <$wfUpdateMetaData("xMinorVersion", xMinorVersion + 1)$>With strings you will need to convert it to numbers and back to strings. Besides, what happens if you have more than 100 minor versions? (you mentioned you want to add 0.01, but that would finally increase the major version, wouldn't it?) So, I think these two numbers are independent (perhaps, with exception that increase on the major version set the minor version to .00).
    If you want to present it, you can use profiles that will construct for you the representation 2.304 out of MajorVersion = 2, MinorVersion = 304
    Solved?

  • How to print a Pdf from Java script

    Hi,
    I need to print a pdf from java script. In java script i have url of pdf. Is there any way to print pdf from java script?
    I am able to print word doc by ActiveX. is there any activeX or something else which do the same thing for pdf?
    Any help heartily esteemed to me.
    Thanks
    Kamlesh Sharma

    you are cross postin .. your thread has been answered in the jsp jstl forums

  • How to Call a JSP from Java Script

    Hi,
    I want to call a jsp from Java Script.
    I am having IntelliJ IDEA 4.5 (IDE) and weblogic server.
    should i do anything on web.xml,weblogic.xml
    I have written one jsp, Java script.
    I want to call a jsp from Java script

    function submitf(){
    document.xyz.action ='ReportSave.jsp';
    document.xyz.method='POST';
    document.xyz.submit();
    <form name='xyz'>
    <input type='text' name='text1'>
    <input type='text' name='text2'>
    <input type='button' name='xx' value='submit' onclick= submitf()>
    </form>
    Is this what u want???
    Regards,
    RAHUL

  • Using admin_client.jar from bash script

    Hello,
    When I make a call "java -jar admin_client.jar" from a bash script I always get 0 for $? even when there are errors reported in the console. How can I check the status correctly?
    S

    Greetings,
    Can you see the console when running the script? I would try to test something simple like -testDatabaseConnection and you should see a result. If you cannot login the the server directly, pipe the output to a file. Next, build up your bash script with additional complexity as you go. Post the results here for the group to analyze.
    THX
    -Michael
    Edited by: Michael F. Hardy on Dec 2, 2008 2:02 PM

  • [Systemd] - How to tell if a service is running in a bash script

    I need a bash script to query systemd (systemctl or systemd or?) to see if a given service is running. Is there a way to do it talking to systemd directly, not by looking for a pid file or seeing if a process is running? Thank you.

    Good point.
    I'd say that, in the case of "RemainAfterExit=yes" services, it's not really black and white. The effects of the service are active, even if the service itself has exited, but it's up to the user to decide whether or not that's "running" in their opinion.

  • How to render liquid tags in the console?

    Hello!
    I have been trying to render liquid tags in the browser's console using Javascript, but it doesn't work.  This is what I have been doing:
    document.getElementById('globals').innerHTML = '<pre>{{globals | json}}'</pre>;
    That just seems to write {{globals | json}} to the web page.

    BC's tag parser is only applied to files that are considered 'pages', and only runs once, when the page is served. It doesn't get applied to javascript files, and it is not directly accessible from the browser.
    If you need to refresh the display of globals without reloading the page, you could create dedicated page that contains only {{ globals }} and GET it with the JSON=true parameter.

Maybe you are looking for