[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)

Similar Messages

  • Is there a reason why some applications have "updates" greyed out and others don't ?

    deploying using Creative cloud packager with Adobe Application Manager disabled
    Some applications have the update option under "help" greyed out while others are not.
    the ones that are not will try to open AAM and fail out when selected but i find it kind of weird that they cant make it the same across the board
    Thanks for any info
    Jeff

    Packager Links https://forums.adobe.com/thread/1586021
    http://forums.adobe.com/community/download_install_setup/creative_suite_enterprise_deploym ent

  • **SOLVED** TrueCrypt - Why would you add it to startup script?

    Hi Guys,
    This might be a stupid question, but...
    I read the wiki entry on TrueCrypt (http://wiki.archlinux.org/index.php/TrueCrypt). I'm assuming the use-case for TrueCrypt would be if someone management to get hold of the hard-disk, the contents would be encrypted, so they stil couldn't be read?
    However the tutorial mentions you can add the mount procedure to your startup scripts so it will auto-mount if the machine is rebooted.
    My question is; if someone has your hard disk (say they plugged it in as a second drive on their laptop, which they did have root access to); wouldn't they be able to read the startup script file and then they would know the password to decrypt the fs?
    Am I missing something..? :S
    --Solved--
    Last edited by tommed (2010-06-04 09:13:57)

    that is true, but if your password is actually a keyfile, and that keyfile is stored on a usb, whenever you boot up with the usb connected, you can automout your encrypted volume.
    this is also a matter of comfort vs security, since if you believe your machine can be compromised, you can remove it from begin auto mounted or leave it when you know your system is currently safe.

  • Why does Firefox run auto on startup?

    I want a browser which can be screend only when I choose to use it. When it runs on startup, it is almost full screen, and gets in the road of email work etc.

    Boot the computer in Windows Safe Mode with network support (press F8 on the boot screen) as a test.
    *http://www.bleepingcomputer.com/tutorials/how-to-start-windows-in-safe-mode/
    You can use the MSConfig program or the Autoruns utility to see which software and services are getting started (be cautious with disabling services).
    *http://technet.microsoft.com/en-us/sysinternals/bb963902.aspx
    It is possible that a program tries to open the default browser, so you can try to set another browser as the default browser to see if that has effect.
    Do a malware check with several malware scanning programs on the Windows computer.
    Please scan with all programs because each program detects different malware.
    All these programs have free versions.
    Make sure that you update each program to get the latest version of their databases before doing a scan.
    *Malwarebytes' Anti-Malware:<br>http://www.malwarebytes.org/mbam.php
    *AdwCleaner:<br>http://www.bleepingcomputer.com/download/adwcleaner/<br>http://www.softpedia.com/get/Antivirus/Removal-Tools/AdwCleaner.shtml
    *SuperAntispyware:<br>http://www.superantispyware.com/
    *Microsoft Safety Scanner:<br>http://www.microsoft.com/security/scanner/en-us/default.aspx
    *Windows Defender:<br>http://windows.microsoft.com/en-us/windows/using-defender
    *Spybot Search & Destroy:<br>http://www.safer-networking.org/en/index.html
    *Kasperky Free Security Scan:<br>http://www.kaspersky.com/security-scan
    You can also do a check for a rootkit infection with TDSSKiller.
    *Anti-rootkit utility TDSSKiller:<br>http://support.kaspersky.com/5350?el=88446
    See also:
    *"Spyware on Windows": http://kb.mozillazine.org/Popups_not_blocked
    *https://support.mozilla.org/kb/troubleshoot-firefox-issues-caused-malware

  • [SOLVED] Avant window navigator runs twice at startup!

    Hi, ive installed AWN and put itin to session menu in XFCE4 to run a startup.
    When i type:
    avant-window-navigator
    It runs fine, but at startup, it runs twice!
    I can see a AWN behind the other. This also happened in KDE4.
    Last edited by B4RR13N705 (2009-08-04 01:26:22)

    In your AWN option menu, do you have the little box checked that says: "Start AWN on login"? (Or something close to that) Try unchecking it, and removing your start up entry from the session manager as well. Test to make sure it does not start when you log back in, then JUST add it to your start up session menu. AWN will figure out it was added and check the box for you.
    I had this problem for a long time in Gnome, and contrived a massive workaround where I had a short script that started it and added the script to the start up menu. Just adding it once is much cleaner.  It's a quark of AWN's built in start up script.
    Alternatively, you could let AWN start itself by checking that box rather than adding it to the session manager after logging back into your XFCE session.
    I hope this helps!

  • Why does CS6ServiceManager runs in 32Bit while all other apps do i 64-Bit?

    It confuses me and seems unnecessary when trying to run a sole 64-Bit system. Why is there no 64-Bit CS6ServiceManager part of the official Adobe CS installation?

    Why is that in any way a problem? What would a 64bit service manager do that the 32bit one couldn't? And contrary to your perception, there are many otehr 32bit components running even on a 64bit system. The "clean 64bit system" is a myth.
    Mylenium

  • Why some PDF docs displayed are garbled and others are not?

    I've had this love hate relationship with adobe for the past few days.  I'm so frustrated since I can't seem to figure why other pdf docs display information correctly while others are garbled. It looks as if the letters/text overlap.  I 'm loosing sleep over this.  I'm at my wits end. Can someone please help? I appreciate any assistance you can provide.
    Thanks,
    C

    Hi Allegria11,
    Don't lose sleep over Adobe! Let's see what we can figure out. But I have lots of questions to get us started:
    Are you creating the PDFs yourself, or viewing PDFs from different sources?
    What are you using to view the PDFs (Reader, Acrobat, and what versions)?
    Do these PDFs all use the same fonts, or different ones?
    Do you know whether the fonts are embedded/subsetted in the PDFs? (You can check by choosing File > Properties and clicking the Fonts tab.
    Let's start there, and we will dig deeper if none of these shed any light on the problem.
    Best,
    Sara

  • Applescript duplicate command runs different as an Application than from Script Editor

    Hi,
    When I run my script from the Script Editor it copies (duplicates) only the new files from one folder to the other one, as desired.  That is, when the file already exists in the destination folder, it just skips to the next one until they are all done.
    However, if I save that very same script as an Application and run it, Finder throws up a dialog box for each item telling me that it already exists and asks if I'd like to Keep Both, Stop or Replace the file.
    I can't figure out why it would run differently as a Script in Script Editor, to how it would run as an Application?  Can somebody please tell me where I'm going wrong? Or perhaps there has been a change in the way Finder and Applescript operate the Duplicate command in Yosemite?
    Interestingly, this problem has only started occurring since I updated to Yosemite.  Before that, on Mavericks, I didn't have this problem!  And I've also just tried the same thing on my other MacBook Pro that's running Mavericks and it works as intended.
    Thanks so much!

    I think the replacing parameter may be broken. The first time I run this:
    tell application "Finder"
      make new folder at desktop with properties {name:"newf"} with replacing
    end tell
    I get a new folder. The second and subsequent times, I get this:
    Unless I'm completely misunderstanding how to use the replacing parameter...

  • Win XP - IllCS2: Startup Scripts

    Page 50 of the Illustrator CS2 JavaScript Reference says:
    Startup scripts
    On startup,Adobe Illustrator CS2 executes all .jsx files that it finds in the startup folders.
    ● In Windows, the general startup folder for user-defined scripts is:
    %APPDATA%\Adobe\StartupScripts
    The Illustrator-specific startup folder is:
    Illustrator_install_dir\Startup Scripts
    I don't see these folders in my Installed Drive.
    Can anyone help please?
    Regards
    Norbert

    Hello Norbert,
    maybe there's no default startup scripts for the Illustrator.
    Don't care of it, create the mentioned folder copy there your jsx and test it.
    Regards,
    Tom

  • [SOLVED] Using gdm, how to make commands run when x starts?

    Hello World!
    I am running arch on a Thinkpad T400, and would love to be able to scroll using the middle button and the trackpoint. I found this article: http://www.thinkwiki.org/wiki/How_to_co … TrackPoint
    and it says to insert some commands into .xsessionrc. The thing is, I'm not sure where .xsessionrc is, or if arch even uses .xsessionrc. (It said it would depend on the distribution.) I tried putting it in .xinitrc, but apparently that only runs with the command "startx", but I'm using a display manager. (gdm). In this thread:
    https://bbs.archlinux.org/viewtopic.php?id=85714
    the person was told to put the script in .kdm, since he was using that display manager. Is there a similar place for gdm where these commands will run at startup?
    If anyone is curious, here are the commands I need to run:
    xinput set-prop "TPPS/2 IBM TrackPoint" "Evdev Wheel Emulation" 1
    xinput set-prop "TPPS/2 IBM TrackPoint" "Evdev Wheel Emulation Button" 2
    xinput set-prop "TPPS/2 IBM TrackPoint" "Evdev Wheel Emulation Timeout" 200
    xinput set-prop "TPPS/2 IBM TrackPoint" "Evdev Wheel Emulation Axes" 6 7 4 5
    Any thoughts, hints, suggestions, or solutions would be appreciated.
    Last edited by TheGuyWithTheFace (2013-07-16 23:22:39)

    You should copy the global file to the location cookies indicated, and then modify the local copy.
    https://wiki.archlinux.org/index.php/Aw … ation_file
    Arch wiki wrote:Whenever compiled, awesome will attempt to use whatever custom settings are contained in ~/.config/awesome/rc.lua. This file is not created by default, so we must copy the template file first:
    It's a good idea to leave that template config file alone (the one in /etc/xdg/awesome), so that when you break your local config (and you will, trust me) you have the template file as a backup.
    You might want to read the wiki page for awesome, and also consult the awesome wiki.
    Last edited by 2ManyDogs (2013-07-16 23:39:56)

  • Why my 2013 Retina MacBook pro aways stop running when it startup

    why my 2013 Retina MacBook pro aways stop running when it startup?
    I try to reset smc and pram .
    but its no work. howhow can I check what happy in my rmbp?

    The startup disk may need repairing ..
    Startup your Mac while holding down the Command + R keys so you can access the built in utilities in OS X to repair the startup disk and reinstall OS X  using OS X Recovery

  • 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.

  • Run command as root at startup

    Hello
    I would need to learn how to run a command at startup as root. Like :
    sudo lxterminal --command="sudo powertop"
    to run powertop at startup so that i can keep an eye on it. (it's the only example i think of right now, but there are some other)
    I've seen some things about tmpfiles.d, but I didn't find anything about running a command. So any help would be very welcome
    thanks,
    Quentin

    Hello,
    As I said, there are many commands I would like to run as root at startup, so I have found a more convenient way. I'm "auto-responding", just in case someone needs it and search this topic:
    http://askubuntu.com/questions/155791/h … a-password
    which consists in creating a script, setting root as owner so that user can't "just run it", and configuring the sudoers not to ask a password for this script, as cris said. Then I can just call the script from the autostart file of LXDE.

  • Why do some applications automatically open at startup

    I just installed mountain lion.  I noticed that when the computer starts up microsoft windows and excel open automatically.  I have another application that does it sometimes as well.  why do some applications automatically open at startup?  How can I change this?

    Quit them before shutting down the computer, and check the list of login items in the Users & Groups pane of System Preferences.
    (104505)

  • Please why doesn't some programs run on the osx mavericks the way it ran on the osx mountain lion, for example , the wizard 101 installer keeps freezing on maverick. Help me !!!

    please why doesn't some programs run on the osx mavericks

    Some apps require updating when a new operating system comes out. Check with the developers of the apps you're having problems with and see if they have an update or workaround.
    Regards.

Maybe you are looking for

  • Buying a Dell monitor for my MacBook Pro

    Hey people, Sorry for being a newbie with this forums, I don't really know if this question should be posted here, considering I will use the monitor with my rMBP or if I should post this at the peripherals section of the forums. Anyway, I'm in doubt

  • Loading data into XMLType column using dbms_xmlsave.insertxml get ORA-29532

    The following simple test case succeeded in 9.2.0.1 but failed in 9.2.0.2. CREATE OR REPLACE procedure InsertXML(xmlDoc IN VARCHAR2, tableName IN VARCHAR2) is insCtx DBMS_XMLSave.ctxType; rows number; begin insCtx := DBMS_XMLSave.newContext(tableName

  • Numeric column not sorting correctly

    I have a datagrid that is populated with square foot numbers. When sorted, it sorts by the first numeral and not the total number. How can I set the column as number and not char?

  • Premiere Pro CC and CS6 freeze on export

    I have a problem with Premiere freezing when exporting a video sequence. The sequence consists of about 5 min of video from 10 different clips, so it not very big. I want to export to H.264 format, but a few percent into the export everything freezes

  • Older Time Machine backups not available in Mountain Lion?

    My wife relies heavily on Time Machine to restore old files that have been deleted or previous versions of a file. Recently I upgraded her Mac OS from Snow Leopard to Mountain Lion. Today she discovered that she is unable to search and/or restore fil