Simple Script and Launchd error

Hi, I 'm just trying to run a simple script tu restart afp services over night, I have try so much things but my script just refuse to run, got error 127 and now just dont know what to do next to make it work. Thanks for your help.
My script Location: /script/afprestrat.sh
sudo chmod a+x /script/afprestrat.sh
The script:
#!/bin/bash
serveradmin stop afp
sleep 2
serveradmin start afp
PLIST location :
/Library/LaunchDaemons/com.compagny.afprestart.plist
the Plist:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
        <key>Label</key>
        <string>com.compagny.afprestart</string>
        <key>ProgramArguments</key>
        <array>
                <string>sh</string>
                <string>/script/afprestart.sh</string>
        </array>
        <key>StandardErrorPath</key>
        <string>/Users/admin/Documents/script/afprestart_err.log</string>
        <key>StandardOutPath</key>
        <string>/Users/admin/Documents/script/afprestart.log</string>
        <key>StartCalendarInterval</key>
        <dict>
                <key>Hour</key>
                <integer>4</integer>
                <key>Minute</key>
                <integer>05</integer>
        </dict>
</dict>
</plist>
Command:
sudo launchctl load -w /Library/LaunchDaemons/com.compagny.afprestart.plist
Console error:
com.apple.launchd com.compagny.afprestart Exited with code:127
and afp service wasnt restart.
Any hint will be really apprciated.
thx !!!

Ok now I got this:
127
com.compagny.afprestart
Ligne 2 and ligne 4 of the script command not found thats mean:
serveradmin: command not found
will try to add the full path of the serveradmin command in the script:
#!/bin/bash
/Applications/Server.app/Contents/ServerRoot/usr/sbin/serveradmin stop afp
sleep 2
/Applications/Server.app/Contents/ServerRoot/usr/sbin/serveradmin start afp
Any better idea ?
thanks !

Similar Messages

  • The overnight maintenance scripts and permissions errors

    I know that the weekly script modifies some permissions when it runs and then disk utility finds them and repairs them. I saw this one this time:
    2008-09-20 20:53:44 -0400: Permissions differ on "private/var/log/secure.log", should be -rw------- , they are -rw-r----- .
    2008-09-20 21:00:28 -0400: Permissions differ on "Library", should be drwxrwxr-t , they are drwxrwxr-x .
    2008-09-20 21:00:43 -0400: Group differs on "private/etc/cups", should be 0, group is 26.
    2008-09-20 21:00:43 -0400: Permissions differ on "private/var/spool/cups/cache/rss", should be drwxr-xr-x , they are drwxrwxr-x .
    The Library one I am not use to seeing. I wonder if the 10.5.5 update changed something.
    Note however, I ran the microsoft office 12.1.2 update before running this one two macbook pros (that are exactly the same). Only one macbook pro had this library thing, but, it hasn't run the weekly script yet either..
    anyone "in the know" know about this library thing?

    Well, I did the 10.5.5 update, ran Repair Permissions afterwards, and did not see /Library error. My /Library is drwxrwxr-t, as it is evidently meant to be. I believe the final "x" on directories is replaced with a "t" to mean that only the owner of files in that folder can delete them. I think it quite possible that it was changed to the more usual x by the the MS Updater. If so, the Repair Permissions process put it back to what it is supposed to be.
    Francine
    Francine
    Schwieder

  • 5800 Java Script and Cookie error

    I currently have a 5800.  Recently when browsing the internet I've been getting a message saying that Java Script is not enabled and sometimes I get a message saying cookies are disabled.  I've checked the settings on the phone but both appear to be ok in that they show as enabled.  Has anyone else had this problem?  Personally I'll be glad when my contract is up as I've had nothing but trouble with this phone!!!
    Thanks for you help
    Fionacam1

    which means??
    so who's problem is it that it doesn't work?? Blackberry or The Citizen Developer?? this only started all of a sudden..up till just recently, there was no problem with this app..and deleting it and reinstalling it doesn't help..

  • I have 12 brand new installs of 27" I-Macs, all running Adobe CC. I have several users trying to make simple saves and getting Error -108 Out of Memory errors.

    The Mac OS is 10.9.5.
    I've already gone into plug ins and Scratch disk preferences and changed the secondary  location to the user's hard drive, but this does not solve the problem.
    I cannot change the "primary " from Startup, but I did change the secondary to the user's ID instead of None.
    These are all brand new Macs in use no more than two weeks.

    Windows 7 includes DirectX 11 in its baseline and it is not necessary to install another version of it.  Your problems may be caused by the installation of the version of DirectX you installed.  Uninstall the one you installed and see if you
    still have the errors.
    Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread. ”

  • Simple scripting:  On frame (45) go back to first frame..??

    I am trying to do a simple script and I am having a huge brain fart.
    when I get to frame 45 I want the play head to go back to frame 1.  I have the below code but I am getting errors.  Can someone point my head in the right direction?
    <><><>
    onFrame (45) {
        this.gotoAndPlay(1);
    <><><>
    One error says that "is expecting semi-colon before or after first brace.....
    second possible error is "call to possible undefined method onFrame....
    Need help.

    If that is the first scene, the in the last frame (45) simply putting...
        gotoAndPlay(1);
    should work.
    If it is not the first scene, then you should label the first frame and use the label instead of the frame number...
        gotoAndPlay("firstFrameLabel");

  • Error while executing a simple script....

    Hi,
    I am trying to run the following simple script in Oracle 8i:
    UPDATE
    vcad_ocorrencias
    set tipo_situa_solic = 'E', desc_obs_atendente = 'ACERTO DE BASE -
    18/10/2004'
    where cod_solicitacao = 7
    and tipo_situa_solic in ('N', 'P')
    and cod_contrato_Inter not in ( 2247,2295,2296,2297,2278,2269,2168)
    and dthora_geracao < '07/10/2004'
    order by cod_contrato_inter;
    And it is returning the following message error:
    ERRO na linha 8:
    ORA-00933: SQL command not properly ended
    Well this script was made by a developer and now I have to run it in production environment...
    Does someone know why it is failing?

    Get rid of your 'order by statement'.
    order by cod_contrato_inter;
    Also make certain that the 'NLS_DATE_FORMAT' is set to 'DD/MM/YYYY' or change
    and dthora_geracao < '07/10/2004'
    to
    and dthora_geracao < to_date('07/10/2004','DD/MM/YYYY')
    UPDATE
    vcad_ocorrencias
    set tipo_situa_solic = 'E',
    desc_obs_atendente = 'ACERTO DE BASE - 18/10/2004' -- not sure if it is a date column
    where cod_solicitacao = 7
    and tipo_situa_solic in ('N', 'P')
    and cod_contrato_Inter not in ( 2247,2295,2296,2297,2278,2269,2168)
    and dthora_geracao < to_date('07/10/2004','DD/MM/YYYY')

  • Downloading 4.0 onto XP it takes a long conection process, with boxes on unresponsive script and a java scipt app saying type error and is all very annoying so what can I do I want the old firefox back a

    I downloaded Firefox 4.0 replacing an earlier Firefox version. I have XP on my computer. When I now click on the Firefox icon after a time a window saying Unresponsive script and underneath script chrome etc comes up. I then press stop script and another window comes up Java Script application and type error. Eventually I get on to the internet but it's all very frustrating. I wish I had ignored the request to download 4.0
    Please help

    I can assure you that the sympton is indeed identical. For as the computer got worse, eventually it refused to start up and made 3 beeps. It has done this before, but today more times than before (just like when it first had this problem). Where-ever you go on the internet, it will tell you that the 3 beeps suggest the RAM is at fault. So, the same 3 beeps, means the same problem, which is the RAM.
    With that in mind, I re-ask my question with the same reasoning and justification; am I still covered under warranty? (Reasoning/Justification: Considering the original problem was not entirely fixed, though something else was to make the MacBook Pro last a little longer before the reoccurance of this problem).

  • Firefox hangs with a "Script not responding" error message; in the meantime there are more and more flashplayer instances running

    Recently I receive errors from Firefox at sites that were working fine before, always the same: a script is not responding, and I can wait, debug or stop. Waiting doesn't help (therefore pointless to change the 'dom.max_script_run_time' setting in the config); and also pointless to debug because the problem is not with the script. "Stop" eventually gets firefox to work, until the next error message which comes very soon.
    I tried to reinstall both Firefox and Flashplayer, even manually wiped the traces from the user profile and program files. They are the latest 35.0.1 and 16.0.0.305 available now.
    => In the meantime, there are reproducing instances of flash players are spawned and running. They stay running even after firefox is closed or terminated.
    => if I disable the flash player plugin everything's fine except of course flash is not working. If I re-enable it, the problem starts over.
    OS is Windows 8.1

    Retard, (I know that sounds hilarious, but I don't know your name - no offense please! )
    Like you said, if this happens only primarily on one of the many sites, it generally comes down to the type of code on that site.
    And after looking at the URL you posted, seems like that page uses a lot of external references - JS and CSS.
    Especially the last few lines:
    <script type="text/javascript" src="http://njcdn.worldsecuresystems.com/CatalystScripts/Java_OnlineShopping.js?vs=b1763.r38875 7"></script>
    <script type="text/javascript" src="http://njcdn.worldsecuresystems.com/CatalystScripts/Java_Cookies.js?vs=b1763.r388757"></script>
    <script type="text/javascript" src="http://njcdn.worldsecuresystems.com/CatalystScripts/Java_Box.js?vs=b1763.r388757"></script>
    Also, a couple CSS, JS references in the <head> section.
    'Display External Files' only disables showing external files - but still loads them.
    Can you try removing the external references and try working with the webpage in DW for a few minutes to see if the same problem persists? If it does, we know what was causing your issue.
    Also, run your site through W3 validator to check and resolve errors: http://validator.w3.org/check?uri=http%3A%2F%2Fwww.healthfirst.com%2Facls-kit.html&charset =%28detect+automatically%29&doctype=Inline&group=0
    Let us know how it goes.
    Good luck.
    -ST

  • How to run 3 job(a,b,c) parallel in unix shells script and after will complete d will start  and we have to handle the error also

    how to run 3 job(a,b,c) parallel in unix shells script and after will complete d will start  and we have to handle the error also

    032ee1bf-8007-4d76-930e-f77ec0dc7e54 wrote:
    how to run 3 job(a,b,c) parallel in unix shells script and after will complete d will start  and we have to handle the error also
    Please don't overwhelm us with so many details!  
    Just off the top of my head ... as a general approach ... something like
    nohup proca
    nohup procb
    nohup procc
    while (some condition checking that all three procs are still running ... maybe a ps -ef |grep  )
    do
    sleep 2
    done
    procd
    But, we'd really need to know what it is you are really trying to accomplish, instead of your pre-conceived solution.

  • What type of errors generally we wil get in script and smartform?

    what type of errors generally we wil get in script and smartform?

    Hi,
    Script and Smartforms are used to Output the outgoing Document print in any orgn.
    Mostly the problem is the allignment of windows on the page.
    Data problems are very little. printing of pages, ie. particular data should come in first page and other on second page,
    and the address should not come in 2 pages,
    displaying of currency related fields errors, texts related errors are the mostly occuring errors.
    reward if useful
    regards,
    Anji

  • Simple Web and regular Web Repository errors... Need Help

    Hello all!
    We're running into a problem with Simple Web and regular Web Repository managers in our QA portal environment.  These repository managers work very well in our Dev portal, but now that we're trying to implement them in QA, of course they aren't working.  :-\
    I set up a specific web site in our Web Repository manager.  However, when I navigate to the repository's folder in KM, it just hangs. When I go to the Component Monitor and look at the Web Repository manager, the server is in red. The Status is "startup failed" and the specific error is:
    "2008-01-07T19:47:48Z: GET /WhitePages/Spider: com.sapportals.wcm.WcmException: sending request to: http://hostname.company.com/ request uri: /WhitePages/Spider Connection timed out:could be due to invalid address (java.net.SocketException: Connection timed out:could be due to invalid address)"
    When I try to set up the same web site in the Simple Web Repository Manager, I receive the same error.  However, we shouldn't need a proxy configured because this is an internal web site.
    This works in our Dev environment, so what configuration should I be looking at specifically?  Any tips from anyone?
    Thanks in advance to everyone!
    Fallon

    Hi,
    As far as I know such type of problems are common in repositroy managers.
    They work on one and don't on the other.
    Possible reasons could be the connectivity and access issues.
    As u r saying that it is an internal website pls chk connectivity of the QA system with the webserver.
    Check ur Repository manager's configuration once again in Sys Admin.
    Last option is to create a new Web RM in QA.
    I know it is irritating but doesn't takes much time right.
    i hope this helps.
    Regards,
    Sumit

  • Error creating folder /scripts and /css with 'upload to ftp host'

    We have had a website designed for us, although I personally would like to update the website as and when needed.
    During the upload to the ftp host at 82% an error message appears regarding the creation of folder /scripts and after pressing resume, another reading /css.
    Once finished the live site is a complete mess. If someone can help expalin simply what is going on and how i can fix this problem.
    Thanks
    Ben

    Refer to a similar thread here with a possible solution to the problem.
    http://forums.adobe.com/message/5082790
    Thanks,
    Vinayak

  • Firefox has crashed numerous times on me tonight, and I keep getting an unresponsive script error (Script: chrome://devany/content/main.js:254) regardless of what website I'm on. NoScript will not block this script, and it's popping up with an increasing

    Firefox has crashed numerous times on me tonight, and I keep getting an unresponsive script error (Script: chrome://devany/content/main.js:254) regardless of what website I'm on. NoScript will not block this script, and it's popping up with an increasing and alarming frequency. It's completely crippled my Firefox, and getting the a large enough window between unresponsive script warnings to get the Troubleshooting Information from Firefox took me a good 20 minutes. It's a very persistent script. I've already re-installed Firefox and restarted my computer, and scanned for viruses/malware. I'm on a Mac, if it makes a difference.
    == This happened ==
    Every time Firefox opened
    == Tonight. I can't say what site I was on, though I first noticed it on DeviantArt and thought it was their new layout producing problems. ==
    == User Agent ==
    Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_5_8; en-us) AppleWebKit/531.22.7 (KHTML, like Gecko) Version/4.0.5 Safari/531.22.7

    yay, I had this same issue, and I too browsed deviantArt and also have got Deviantanywhere add-on installed. : D
    I'm so glad that You've found a solution and shared it with us.
    I was really getting worried that I'd done something to get malware installed on my 'puter. *Phew* !!
    I'm going to disable DeviantAnywhere after I post this and hopefully this will be fixed for me too!
    I actually hadn't kept my firefox up to date. but.. *shh...*
    I updated it and after I did, it told me that there was a script running that was not responding. : )
    yay for FireFox~
    ~QuinsY.

  • SQL Server upgradation Issue : 2012 to 2014. A job step received an error at line 1 in a PowerShell script. The corresponding line is 'set-executionpolicy RemoteSigned -scope process -Force'. Correct the script and reschedule the job.

    Message
    Executed as user: CORPTST\XXXXX. A job step received an error at line 1 in a PowerShell script. The corresponding line is 'set-executionpolicy RemoteSigned -scope process -Force'. Correct the script and reschedule the job. The error information returned
    by PowerShell is: 'Security error.  '.  Process Exit Code -1.  The step failed.
    I receive this error during the sql server job 'syspolicy_purge_history' execution  when sql server got upgraded form SQL Server 2008 to 2014.

    Hi Vishnu,
    According to the error message, it also occurs in SQL Server 2012.  Here is a feedback about the error in the link below.
    https://connect.microsoft.com/SQLServer/feedback/details/754063/sql-server-2012-syspolicy-purge-history-job-step-3-fails-with-security-error
    To resolve this issue, please change the value of the following registry key from ‘RemoteSigned’ to ‘Unrestricted’. For more details, you can review this similar
    blog.
    HKLM\SOFTWARE\Microsoft\PowerShell\1\ShellIds\Microsoft.SqlServer.Management.PowerShell.sqlps120\ExecutionPolicy
    Thanks,
    Lydia Zhang

  • Shell Script: Timeout and return error if Sqlplus hangs

    Shell Script: Timeout and return error if Sqlplus hangs
    Dear all,
    This morning, our production database hung with lots of ORA-600 and 7445. The issue has been escalated to Oracle Tech support but my monitoring script which tries to make a connection every 5 mins to the database to see if its up, did not alert me. The reason is that, it connected to the database and hung, never came out to report an error and so I never got alerted until a user called me.
    Can any one tell me how I can exit from the sqlplus block if I dont get a response in x seconds? This sqlplus block is being called with in a shell script.
    Any help is highly apprciated.

    I don't know of anything built into any shell scripting language that would do this, no. I'm not a Perl programmer, but I have a vague recollection that Perl may have something useful here.
    From the "separate thread" part of my comment, though, you could certainly spawn a separate thread (thread 2), have thread 2 wait a period of time, then look for a message from thread 1 and throw an error if the message hadn't been sent. I don't know that I'd be for writing multi-threaded shell scripts, though. The heartbeat also gives you a layer of redundancy so that something is monitoring the monitor in case that process stops working.
    Justin

Maybe you are looking for

  • How can I disable a method from a direved class

    I am extended TreeSet for an assigment with some new functionality. This new class is rbTree. I need to disable all of the old functions so that if a user creates a new rbTree he will only be able to use the methods defined in rbTree. rbTree uses som

  • I have just installed the new version of quick time but my Itunes is still telling me that it needs quick time to play the film.

    Can anyone help me fix my itunes? I have the new version of quick time but it is now telling me it wont play my films on itunes because it needs quicktime. Iv tried un installing quicktime and re installing it but that hasnt worked. I dont know why i

  • Facebook is missing from the 'Share' menu

    I have successfully moved my iPhoto library to Photos. I wish to upload some pictures to Facebook, but under the Share button, my only options are 'iCloud Photo Sharing' and 'More' - which only opens the settings. Under 'Internet Accounts' inside Sys

  • Request Response : Direct bindings

    Hi all, I want to expose a schema as a webservice in BizTalk, but my orchestration instead of having a specify later port bounded to my receive location, it's bounded directly to the message box how can i handle that by consuming the message request

  • Solaris volume manager and RPC

    I'm trying to run as few services as possible? Does anybody know if there are dependencies between Solaris Volume Manager (formerly DiskSuite) and rpc? I know that Solaris Volume Manager uses something called rpc.metamhd, but I'm not sure if this req