Systemd startup script - half of the commands run, half don't??

i have a previous rc.local file which was a startup script on a router machine i have. it is designed to run tcpdump commands for the interfaces and output them to terminals tty9, tty10, and tty11. it worked perfectly...
i have since transitioned to systemd. I followed wiki instructions to make a oneshot service file and have enabled it. here is the file: (/usr/lib/systemd/system/startup.service)
[Unit]
Description=Startup Script
After=iptables.service
[Service]
Type=oneshot
ExecStart=/etc/scripts/startup
[Install]
WantedBy=multi-user.target
here is the script /etc/scripts/startup: (email addresses disquised)
#!/bin/bash
route add -net 10.11.12.0/24 gw 172.16.16.4
/usr/sbin/tcpdump -pnq -i external >> /dev/tty11 &
/usr/sbin/tcpdump -pnq -i internal >> /dev/tty10 &
/usr/sbin/tcpdump -pq -i wifi >> /dev/tty9 &
echo "$HOSTNAME system startup complete `date '+%r %x'`" | /usr/bin/mailx -c "[email protected]" -s "$HOSTNAME Startup Message" [email protected]
here is the output from the startup command with journalctl:
Nov 18 22:46:10 pLAN9-Gateway systemd[1]: Starting Startup Script...
Nov 18 22:46:10 pLAN9-Gateway systemd[1]: Starting OpenSSH Daemon...
Nov 18 22:46:10 pLAN9-Gateway systemd[1]: Started OpenSSH Daemon.
Nov 18 22:46:13 pLAN9-Gateway startup[409]: . . . message not sent.
Nov 18 22:46:13 pLAN9-Gateway systemd[1]: Started Startup Script.
the route add command runs, but nothing else does. as you can see, there is absolutley NOTHING helpful in the log, other than the completely useless "message not sent" output from mailx. running the startup script manually with "systemctl start startup" works fine.
iptables.service is setup to run After=netcfg.service, so I would assume that beucase the startup script runs after iptables, it should run after netcfg as well.
why aren't these commands running?

A oneshot service is killed once the main process returns (that's why it is called a "oneshot"). Your tcpdump processes are killed once startup returns.

Similar Messages

  • Oracle 11gR2 systemd startup script

    I would like to write down the systemd startup script here for I can't find any on the internet. wish people don't have to browse around and find nothing.
    everything on internet is about 9i and no systemd startup script example.
    I hv tried several times that the script runs right and start up oracle at bootup.
    Issuing systemctl and it returns the following
    oracle.service                loaded active exited    Oracle database serverthe script is working on my Fedora 18 x86_64.
    Please give your input if you find mistake, error, or anything wrong.
    Thank you
    oracle.service
    [Unit]
    Description=Oracle database server
    After=syslog.target network.target
    [Service]
    Type=oneshot
    User=oracle
    Group=oinstall
    RemainAfterExit=yes
    ExecStart=/bin/oracle.sh;
    [Install]
    WantedBy=multi-user.targetoracle.sh
    #! /bin/bash
    #  script used by oracle.service
    ORACLE_HOME=/home/oracle/app/oracle/product/11.2.0/dbhome_1
    ORACLE_SID=orcl
    ORACLE_BASE=/home/oracle/app/oracle/product/11.2.0
    $ORACLE_HOME/bin/lsnrctl start;
    $ORACLE_HOME/bin/dbstart $ORACLE_HOME;

    newbieRyan wrote:
    I would like to write down the systemd startup script here for I can't find any on the internet. wish people don't have to browse around and find nothing.
    everything on internet is about 9i and no systemd startup script example.Really??!?!?!
    I googled 'start oracle on linux startup" and the very first hit is pretty much the standard reference on the subject: http://www.oracle-base.com/articles/linux/automating-database-startup-and-shutdown-on-linux.php
    I hv tried several times that the script runs right and start up oracle at bootup.
    Issuing systemctl and it returns the following
    {code}
    oracle.service loaded active exited Oracle database server
    {code}
    the script is working on my Fedora 18 x86_64.
    Please give your input if you find mistake, error, or anything wrong.
    Thank you
    oracle.service
    {code}
    [Unit]
    Description=Oracle database server
    After=syslog.target network.target
    [Service]
    Type=oneshot
    User=oracle
    Group=oinstall
    RemainAfterExit=yes
    ExecStart=/bin/oracle.sh;
    [Install]
    WantedBy=multi-user.target
    {code}
    oracle.sh
    {code}
    #! /bin/bash
    # script used by oracle.service
    ORACLE_HOME=/home/oracle/app/oracle/product/11.2.0/dbhome_1
    ORACLE_SID=orcl
    ORACLE_BASE=/home/oracle/app/oracle/product/11.2.0
    $ORACLE_HOME/bin/lsnrctl start;
    $ORACLE_HOME/bin/dbstart $ORACLE_HOME;
    {code}

  • Why are systemd startup scripts under /usr/lib and not /etc? [SOLVED]

    Just out of curiosity: why are systemd configuration files (startup scripts, or whatever they are called) in /usr/lib/systemd/system/ and not somewhere under /etc?
    After all, they are configuration files and not libraries.
    It may simply be my lack of knowledge of the standard linux filesystem layout, so please enlighten me.
    Last edited by louic (2015-04-09 09:12:11)

    https://wiki.archlinux.org/index.php/Sy … unit_files

  • Auto startup/shutdown virtualbox and the machine running in it ?

    i am trying to use the phpvirtualbox to control the running of the virtualbox. although i am still using the rc.conf start the phpvirtualbox, i saw there was a way to start it up by  systemd. the question is, in order to start phpvirtualbox, you need to start the a virtualbox first (am i right ?), but how. also, when i want to shutdown the server, i have to stop the phpvirtualbox, the vm (which is xp in my case) inside the virtualbox and then the virtualbox, but how ?

    Robert Kempner wrote:
    Do I need to have "Time Machine" running in the background all the time ...
    It is how it is designed to be used. How Time Machine Works its Magic
    Robert Kempner wrote:
    ... can I turn it off and on say, once a week?
    Why..?
    Perhaps TM is not for you... See Time Machine vs. Clones and Archives
    More Info here >  http://www.reedcorner.net/guides/backups/ch2.php

  • Severe startup problems (sounds like the hard drive is done.)

    Hey all,
    Last night, I attempted to wake my iMac out of sleep mode. The screen prompting me for my username and password came up, and I entered in my password. After pressing enter, the system hung and all I saw was the colored spinwheel.
    I shut off the machine, and restarted it. I still hear the Mac start-up sound, but the system hangs at the grey Mac loading screen with the twirling circle. After a few moments, I can hear the fans kick on, and they're louder than ever.
    After a few times of restarting the machine, and letting it hang, the grey screen eventually faded away and a new screen, a black screen with white lettering (very similar to DOS), came up and gave me the following text:
    "diskOs3: I/O Error.
    /etc/master.pssword: Input/Output error
    diskOs3: I/O Error.
    -sh:/etc/profile: Input/Output Error
    -sh-2.05b#
    -sh-2.05b#"
    As you can see, I'm pretty dumbfounded by this. After looking at this screen for a couple minutes, I tried typing on my keyboard and saw that like DOS, I could type commands. I tried typing "exit" and after I pressed enter, a little text box featuring "LOGOUT" came up. But nothing happened.
    Anyway, this is my situation. I've tried resetting the PRAM, and since I have a Rev-2, I don't have to manually reset the SMU or whatever it is.
    If worse comes to worse, I still have my Apple Care warranty (I purchased it less than a year ago.) I would definitely prefer to not lose all my data, though.

    I just wanted to follow up with this. I had to do a fresh install of Mac OS X, which is unfortunate. I got all my music and movies and such from my other Mac computer, including some key programs.
    That was 5 days ago.
    Today, I installed Photoshop CS and attempted to launch it for the first time. As the program was initializing, it hung. Not figuring this was anything to worry about, I tried force quitting the program but it didn't work. The entire system had locked up. I turned off the computer, and turned it on again, and surprise: I had the same problem. The hard drive crashed.
    So...this has happened twice in two weeks. What's going on here? The hardware tests show nothing wrong with the hardware; surely, it's got to be something right?
    I did the smart thing this time and backed up all my essential programs and files in case this happens a 3rd time. If it does happen a 3rd time, I'm going to give Apple a talking to. I love their products, but something fishy is going on here.

  • [SOLVED] Why some commands run properly in startup script others don't

    I am trying to finish setting up my MythTV box. I have the following commands to run at startup:
    #!/bin/sh
    # Stop spamming dmesg
    echo -n 0000:00:06.1 > /sys/bus/pci/drivers/ehci_hcd/unbind
    # Enable wake from remote
    echo enabled > /sys/bus/usb/devices/4-5/power/wakeup
    # Link optical drive to /dev/dvd (needed for myth)
    if [ ! -e /dev/dvd ]; then ln -s /dev/cdrom /dev/dvd; fi
    # Start LIRC
    echo lirc > /sys/class/rc/rc0/protocols
    ln -sf /run/lirc/lircd /dev/lircd
    lircd -d /dev/lirc0 /etc/lirc/hipermc
    # Start mythbackend
    mythbackend &
    # Start LCD server
    LCDd &
    I have tried making this part of rc.local and also as a startup item in XFCE (with script called using passwordless sudo since it requires root permissions). In each case, only some of the commands run properly (the dmesg, wake from remote, and start LIRC sections). The other commands don't seem to work. However if I run the script manually after the computer has finished booting, everything works perfectly. Can anyone help me figure out what's going wrong?
    It seems like path is already set since some commands do work without the full pathname. Also please don't suggest using systemd for starting the daemons - it does not work for me with LIRC or lcdproc and there is a driver bug with my hardware that keeps me from using the mythbackend systemd service.
    Thanks in advance for the help.
    Last edited by mosquitogang201 (2012-12-16 14:42:11)

    The exec command was what I needed. Was able to follow the error messages to find out the command im using under "stop spamming dmesg" was messing everything else up. Also I am running systemd - just not using it to start these items since the systemd service files weren't working reliably.
    Anyways this brings me to another question - is there a more elegant way to stop dmesg from getting spammed? About 5 times per second I get the error
    hub 2-4:1.0: unable to enumerate USB device on port 3
    which makes it very difficult to look through dmesg logs to find an actual problem.
    EDIT: Just needed to add the sleep command after the dmesg section to give the kernel enough time to reload using ohci_hcd. Now script is working perfectly. Marking as SOLVED.
    Last edited by mosquitogang201 (2012-12-16 14:48:47)

  • How do I keep the command window open?

    I want to write a batch file that will leave the window open after running so I can see what the output is.
    I kind of remember having to use %k
    But I'm not sure exactly how to do it.
    UPDATE: I found what I was looking for, it's /k when you execute the command file.
    If anyone has any additional comments about scripting and keeping the command window open, please comment.

    Add "pause" to the end of the batch.
    ¯\_(ツ)_/¯

  • Startup Script folder empty - no Bridge CS5 Output to Web?

    Something must have gone wrong installing CS5 Photoshop over CS4 Indesign!
    Even after net-updating to Bridge 4.0.2 the startup script folder (Preferences > Startup Scripts) is empty. When selecting the Output Workspace in Bridge, there is no pane that let one output to Web Gallery or Contact Sheet.
    I'm doing this meanwhile in CS4 Bridge, where it works fine. This Bridge version was coming with CS4 InDesign.
    I downloaded CS5 Photoshop in April (I guess it's an International English upgrade) running it on OSX 10.6.4 on a new 17" Book.
    Is there an upgrade coming, how can I achieve full functionality of Bridge CS5?
    Than you in advance for your input,
    Bernd Rummel

    Hi Omke,
    I did download and install the Photoshop CS5 upgrade by April. Since the Output to Web Gallery pane was not there at the Output workspace as well as all Sartup Scripts are missing at Bridge Preferences, I completely reformatted (actually changed the partitions) and reinstalled OSX 10.6.3, my 17" Book came with. Than I upgraded to OSX 10.6.4.
    Now, before doing (screwing up) anything else, I installed Acrobat 9 and run the rather lengthy process of installing each and every upgrade to the latest version. Than I installed InDesign CS4 (version 6) and upgraded this. Finally I installed Photioshop CS5, only to still have the Startup Scripts and subsequently the output to web gallery pane missing. Of course, also the Twitter and Facebook stuff is not there. However, this is not my concern since I do not use them.
    The upgrade to Bridge 4.0.2 didn't change anything, so didn't todays upgrade to Photoshop 12.0.1.
    Please note that I do not use the CS Suite but upgrade Adobe Acrobat, InDesign and Photoshop individually, which used to work fine for many years. And so I have Bridge CS4 and Bridge CS5 installed side by side. At the CS4 version the Startup Scripts and Output to Web Gallery does work as expected the CS5 version of Bridge is short of both. This shouldn't happen, since I installed CS5 Photoshop over Bridge CS4.
    Actually two weeks back I tied to un-install both the CS4 Bridge as well as the CS5 Photoshop, and than to just install Photoshop CS5 without InDesign with Bridge CS4 being installed. The Startup Scripts and Output to Web Gallery wasn't there either.
    Do you think I can get an other Photoshop CS5 softcopy somewhere that makes my serial number as well as the output to web gallery work? This would turn me back to be a happy photoshopper that I am since version 2.5... when I switched from Cibachrome in darkroom to Photoshop on Mac now about 16 years back.
    I look forward to your input.
    Bernd

  • Not allow users to disable startup script

    I have written a User Login script for indesign and have successfully implemented in Indesign CS3. However, anyone can disable the login script that I have put in the Startup script by modifying the Preference setting of the Indesign.  I would be very grateful if any one there could suggest me on how to not allow the users to disable the login script put inside the Startup Script folder.
    Thanks,
    Limbu, Keshar

    Thank you very much for you response. But, it is not about the user right permission. There is a selection options in the Perference setting of Indesign. If you untick that option, Indesign will run bypassing the scripts in the startup scripts folder. Is there any way to not allow the users to not select this option so that the startup scripts does not get bypassed?
    In the above preference setting the last check box is not selected hence Indesign will bypass all startup scripts. Only if this last option is selected the startup scritps will run.
    Thanks
    Limbu Keshar

  • Registry startup script for computer-based proxy configuration

    I am attempting to deploy computer-based proxy server settings via importing a .reg file to user PCs as a startup script. It has appeared to work on some PCs but not on others. We have a mix of Windows XP Professional x86 and Windows 7 Professional x64 PCs
    in our domain.
    I am not sure whether to use "reg import" or "regedit /s" in my batch script.
    Before trying the batch script method, using "Computer Configuration > Preferences > Registry" settings did not work.
    I have created a GPO, applied it to an OU containing computers and used the following settings:
    Computer Configuration > Policies > Windows Settings > Scripts > Startup
    Batch Script: regedit /s \\FQDN\netlogon\wmproxy.reg
    Registry File:
    Windows Registry Editor Version 5.00
    [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Internet Settings]
    "ProxyEnable"=dword:00000001
    "MigrateProxy"=dword:00000001
    "ProxyOverride"="<local>"
    "ProxyServer"="proxy.FQDN:8080"
    Computer Configuration > Administrative Templates > Windows Components/Internet Explorer
    Disable changing proxy settings = Enabled
    Make proxy settings per-machine (rather than per-user) = Enabled
    As at the beginning of my post, the settings deploy to some PCs but not all and I have yet to see it work on the Windows 7 PCs. Am I attempting computer-based proxy settings the wrong way, or am I missing something with how I am currently trying to deploy
    it?
    Thanks all!

    Hi,
    You mentioned you have tried to configure the computer-based proxy settings via GPP but it didn’t work. Before going further, would you please let me know how did you configure the settings?
    In order to narrow down the cause of the issue, I suggest we’d better collect the following information.
    GPMC.log
    ==================
    a. On domain controller, click Start ->Run, type GPMC.MSC, it will load the GPMC console.
    b. Right click on "Group Policy Result" and choose wizard to generate a report for the problematic computer and user account (please place appropriately). (Choose computer and select the proper
    user in the wizard)
    c. Right click 
    the resulting group policy result and click the "Save Report…" => save report to save the report to a HTML file.
    Once we get the GPMC.log, please check the detailed report logged in it.
    You said you have created a startup script to edit the registry key to configure the proxy setting of the computer but it worked on only some of the computers in the domain. Have you tried
    to run the script on the problematic computer manually to see if it works? If it still fails to run, it could be related to the script issue, then we’d better ask in the script forum.
    The Official Scripting Guys Forum!
    http://social.technet.microsoft.com/Forums/en-US/ITCG/threads
    Regards,
    Andy

  • Missing startup script for version cue

    I'm having the problem where I don't seem to have the startup scripts for version cue in bridge.
    When I check the list of startup scripts in preferences, the other scripts all seem to be there like for contribute, fireworkds etc. However version cue is missing.
    I also checked the actual locations for the startup scripts.
    The scripts for version cue seem to be in the actual locations but for some reason they're not running or showing up in bridge or that's what I'm assuming anyway.
    I'm running bridge CS4 and version cue CS4.
    If anyone could help me that would be great!

    What then do they recommend?  The URL listed below is broken/no longer available.  The solution listed above does appear to work.  I installed Version Cue Server CS4 after having installed the rest of the suite on my workstation.  I used drive to link to the server(my machine which I am using for testing).  I had CS3 on this machine before uninstalling it and installing CS4.
    Re: Missing startup script for version cue
    Matthew Laun wrote:
     Adobe recommends that you do not follow the steps above to enable Version Cue CS4 in Bridge CS4.
    Please see this thread for more details:
    http://www.adobeforums.com/webx/.59b6d12f

  • CC startup script to set Preference "Default Composer"?

    I have a startup script that I wrote for CS3 that controls about 20 preferences.
    One of the preferences was for Composer, which was by: app.textDefaults.composer = "Adobe Single-line Composer"
    This script has worked for CS 3, 5, 5.5, and 6 (we skipped 4)
    We're moving to CC and my script still works, but I see a new preference at Preferences > Advanced Type for "Default Composer"
    I get lost in ExtendScript's Object Model Viewer, so would someone be kind enough to tell me what to add to my startup script to set the Default Composer to Adobe Single-line Composer
    Thanks for your time
    Tom

    It seems to be related to app.textDefaults, but it seems to me that it's broken...

  • Missing bridge startup scripts

    In bridge CS4 I am trying to use the Output feature to create a PDF contact sheet. However, when I click on that, I get a new workspace but I get no features in the output panel, it's blank. In reading the bridge PDF help manual, it says that one should use the Adobe Output Module script to do this: "If the Output workspace is not listed, select Adobe Output Module in Startup Scripts preferences." However, when I go to Preferences, Startup Scripts, and select "reveal scripts" there are no scripts shown at all.
    Where can I find them? Is this also why when I select the "Tools" menu item, there is no "Photomerge" choice?

    I have gone to Bridge->Preferences->Startup script panel. The Adobe Output Module is not listed. In fact, there is nothing listed in the panel.
    I have installed Photoshop CS4 but the photomerge options do not appear on the Tools->Photoshop menu of Bridge as they did in CS3. The only choices that appear are "Batch rename", 4 Metadata items, and "Cache".

  • Command runs multiple times

    I'm using CR 11.  I have a report with one command.  This command provides the data for the report detail, but it is also used as the source for 3 LOVs for filtering.
    The issue I have is this:  The report takes to long to generate.  When I monitored the database activity, it looks like the command runs 4 times for each run of the report.  I would have expected that the command needs to run just once, since it returns the same data each time.
    Is this behavior normal?  If not, is there a workaround?

    As I said, LOV's are subreports and each subreport makes it's own connection. If you have BOE when saving a report with an LOV it saves the LOV as a subreport, you can then run the subreport to prepopulate the List.
    Using a Cascading Parameter will do exactly what you are doing.... First parameter is the Country, which then filters the cities in that Country and then after selecting the City it filters the on the zipcode....
    Actually you would want to add the State/Province in there also....
    There is a sample report on your hard drive called Prompting or get if from here:
    https://smpdl.sap-ag.de/~sapidp/012002523100005852352008E/cr_xi_xtreme_rep_smpl_en.zip
    It shows you how to use Cascading parameters
    Don

  • Admin console VS Startup Script

    Hi!
    I'm very confused about this subject. I understand that Admin console uses Node Manager to start/stop managed server, but i dont't understand why using Admin Console the Managed Server is started with JRockit and via startup script is started with Sun JDK.
    Thanks a lot
    Best regards

    Hi,
    When starting the managed servers from the admin console, you are indeed using the Node Manager. But in this scenario, the NM is using the properties defined in the startup properties for each of the managed servers, not the properties defined in the startup scripts. If you want Node Manager to use the startup scripts when starting the managed servers, you must change the value of the "StartScriptEnabled" parameter to "true" in the /wlserver/common/nodemanager/nodemanager.properties file.
    I hope this helps.
    Regards!
    Edited by: Radu Dobrinescu on Dec 14, 2010 1:23 AM

Maybe you are looking for