How to add startup script to OSX?

Hi,
Now , There is an applicaition(run as root).
I want to add it to startup items via script.
On Linux, The script can be added to /etc/rc.d/rc.local.
Another,The application run as root,
Every time use sudo app, and user has to input password,
how to run it without any input?
If it is impossible, I need to remove user role check from application?

Yes, I am sure of that they are owned by root,
and have same mode(File/Dir) as the example.
This is not useful yet???
I give the 3 files content as follow:
1: upsilon
#!/bin/sh
. /etc/rc.common
StartService ()
ConsoleMessage "Starting Megatec System tech. UPS monitor"
/etc/upsilon/upsilon start
StopService ()
ConsoleMessage "Stopping Megatec System tech. UPS monitor"
/etc/upsilon/upsilon stop
RestartService () { StopService; StartService; }
RunService "$1"
2:StartupParameters.plist
Description = "Megatec System tech. UPS monitor";
Provides = ("upsilon");
Requires = ("Network");
OrderPreference = "Late";
Messages =
start = "Starting Megatec System tech. UPS monitor";
stop = "Stopping Megatec System tech. UPS monitor";
3:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist SYSTEM "file://localhost/System/Library/DTDs/PropertyList.dtd">
<plist version="0.9">
<dict>
<key>Starting Megatec System tech. UPS monitor</key>
<string>Starting Megatec System tech. UPS monitor</string>
<key>Stopping Megatec System tech. UPS monitor</key>
<string>Stopping Megatec System tech. UPS monitor</string>
</dict>
</plist>
There are any problems on the files?

Similar Messages

  • How to setup startup script in Solaris 10

    Could anyone point me out how to setup a startup script at run level 3 or 2 in solaris 10 ?
    Any previous solaris such as 9, 8, I just write a script and put in /etc/init.d/, then link it to run level 3 or 2. But in solaris 10 is different now.
    I could not find any in the manual.
    Thanks.

    Could anyone point me out how to setup a startup
    script at run level 3 or 2 in solaris 10 ?
    Any previous solaris such as 9, 8, I just write a
    script and put in /etc/init.d/, then link it to run
    level 3 or 2. You can do the same thing in Solaris 10.
    But in solaris 10 is different now.There are alternative methods that are recommended (creating a service via a manifest file), but the old startup stuff still works just fine. You don't get the benefits of monitoring and fine-grained dependencies with the legacy startup scripts.
    I could not find any in the manual.An older doc is http://mediacast.sun.com/share/bobn/SMF-migrate.pdf. You might also check the SMF FAQ.
    http://opensolaris.org/os/community/smf/faq/ Section 4 is on manifest development.
    Darren

  • Bridge can't find Startup Scripts on OSX (CS5, CS5.5, CS6)

    I just spent a few hours trying to figure out why Bridge could not be launched from Photoshop, and also why the Stratup Script panel in Bridge Preferences was empty.
    On the chance someone else has this issue, I have found one cause for the problem on OSX... and I must say it is rather stupid.
    If you have a volume named "Library" mounted, either a local volume or a server volume, Bridge expects to find its startup scripts on it. You can either rename the volume, or if that really isn't an option, you can create a folder path of /Application Support/Adobe on the Library volume and copy the /Library/Applications Support/Adobe/Bridge CS6 Extensions  and  /Library/Applications Support/Adobe/Startup Scripts 6.0 folders to that new folder.
    Obviously renaming the volume is the easiest. Replace CS6 in the paths above with CS5 or CS5.1 if you also use those products.
    If you have encountered this error in Photoshop when opening bridge, you may have a volume called "Library":
    Error 2: photoshop is undefined.
    Line: 1
    -> photoshop.invokeBridge (false, false, '');

    If you have a volume named "Library" mounted, either a local volume or a server volume, Bridge expects to find its startup scripts on it. You can either rename the volume, or if that really isn't an option, you can create a folder path of /Application Support/Adobe on the Library volume and copy the /Library/Applications Support/Adobe/Bridge CS6 Extensions  and  /Library/Applications Support/Adobe/Startup Scripts 6.0 folders to that new folder.
    I'm sorry but I certainly can't second this advise, in fact I'm strongly against it. Mac Os uses 3 libraries, one at root level, one in the system folder on root level and one on user level, by default hidden per OSX 10.7.
    That is for a single user set up.
    Creating folders in those libraries yourself should only be done with great care and good knowledge but rather you should let this be done during default installation of the applications themselves, they have been designed to place the folders they need to use to work under the correct name and path, otherwise they won't recognize the needed files or script or preferences.
    Renaming the library folder or creating a folder called library your self is a bad idea because all applications use the default root- and user library for various tasks as does the system itself.
    If your initial installation ended up without having access to the other applications using the start up scripts inBridge the install either went wrong or your copy of the software is not correct.
    The default location for the start up scripts should be in the library at root level and that would make the path: Macintosh HD (or the custom name you gave to the start up disk) / Library / Application support / Adobe / Startup Scripts CS6.
    Inhere should each installed application of the CS6 suite have a folder with its application name. These folders contain the needed scripts. Some have only one and some have more. the particular script to run Photoshop is called "photoshop.jsx".

  • How to add powershell script code in form application in C#

    Hi,
    i am creating a form application in C# and have powershell code which will create remote session on remote machine and execute few commands like set execution policy copy some share files install that files etc.
    I have to add this powershell script into form application in C#.
    Can some one please give me some example how to add the whole script which i have into C# code form application. Thanks in advance
    Thanks,

    Hi
    So the left is Run PowerShell Commands on Remote machine? Am I right ?
    Here  is a article talking about running  powershell commands on Remote Computers.
    http://www.howtogeek.com/117192/how-to-run-powershell-commands-on-remote-computers/
    About how to write in C#, please follow
    Joel Engineer's reply, using  process.Start() method  to start
    PowerShell.exe and Run PowerShell Commands to connect remote machine.
    Best regards,
    Kristin
    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.
    Click
    HERE to participate the survey.

  • How to add/modify and edit OSX Account in my code

      Our company need to build a OA system, need to combine our Web OA and OSX Server' features, now need to CRUD(add/modify/delete/view) OSX Contact's account user data and group data, how to implement it in PHP Code or cocoa-touch code?

    Weird... When I set up an new account there are no "advanced" options. It requests name, email address, and password then it polls for the account and finds it and done. When I go into mail>prefs>accounts my only options under "advanced" is this http://twitpic.com/5fb41x

  • How to add java script option in firefox as this is not available in the menu of tools menu and content of firefox

    Dear sir,
    I am regular computer user and firefox is my default web browser. But it is seen that my web browser is not having the option of enable java scripts as I am learning web page designing. Could you please tell me how to add this option in my web browser on mozila as I am interested to work mozila all the time. I can add this by using internet but that is not always easy and also not sure when this option is enable or disable. Please guide me resolving my problem.
    Regards,
    Mohammad Hossain

    You can no longer do that via the user interface, but you need to check the related pref on the <b>about:config</b> page.
    The <b>javascript.enabled</b> pref should be true on the <b>about:config</b> page to enable JavaScript.
    You can open the <b>about:config</b> page via the location/address bar.
    You can accept the warning and click "I'll be careful" to continue.
    *http://kb.mozillazine.org/about:config
    See also:
    *QuickJava: https://addons.mozilla.org/firefox/addon/quickjava/

  • Add Startup scripts to Bridge

    hello
    I would like to do as above, with InDesign you have a fodler called Scripts/Startup Scripts with scripts inside can i do the same with Bridge CS6?
    Thanks

    There are 2 startup script folders with Bridge…
    One contains the Adobe Scripts that provide the built-in functions…
    Library/Application Support/Adobe/Startup Scripts CS5/
    Most likely the one you want though is the user one…
    You can reveal this if you go to the app preferences…

  • How to add macbook pro with OSX 10.9.2 to Windows Server 2008 Domain

    I would like to add my late 2013 MBP running OSX 10.9.2 to my company's Windows Network Domain.
    What is the procedure to do so?
    Thanks for your help.

    You ensure that the Mac is in time sync with the domain controller, you hope that you are not on a .local domain, and then you can use System Preferences > Users & Groups > Login Options > and the Join button.  This will provide a simple binding interface.  I prefer to use Directory Utility (there is a button to assist you in launching the tool) as it exposes more of the AD plugins features.
    Alternatively, this can be scripted using dsconfigad.  Or, if you want to explore third party options, there is Centrify, the stuff from Thursby, and others.
    Once you have bound the machine to the domain, you can validate connectivity by using the id command in the Terminal.  Example would be:  id someuser
    someuser should be replaced with the short user name of a user in the Active Directory domain.  If you get back a truncated record of the account, then you are talking to the domain and should be able to authenticate at the login window.
    Be aware that if you have a name conflict (you already have a local account called naresh on the Mac and the AD short name is the same), then you will always login to the local account.  Remove the account or rebuild the local DS database and establish a default local admin account without a conflicting name.
    AD binding is a very easy and highly recommended task for all Macs in Windows centric environments.  It makes the Mac a first class citizen and capable of respecting password policy and access rights.  Do not, you can not push GPO to the Macs without tools like Centrify.
    Reid
    Apple Consultants Network
    Apple Professional Services
    Author "Mavericks Server – Foundation Services" :: Exclusively available in Apple's iBooks Store

  • How to add a script to the toolbar script?

    How do I make an Automator script/application into a script accessible from the toolbar?  In the toolbar I have the Script icon.  I'd like to be able to access my own script from there from a third-party app.  Can this be done?

    Hi Albert.
    You need to do a few things for that :
    - Create your own GUI status by copying STANDARD_FULLSCREEN from function group SLVC_FULLSCREEN.
    - Set your own PF-Status using the Exclude table because otherwise your exclude table would become meaningless.
    - define a subroutine to handle the user commands.
    Sample implementation :
    FORM pf_status USING extab TYPE slis_t_extab.
      extab = pf_exclude.   
      SET PF-STATUS 'STANDARD' EXCLUDING extab.       
    ENDFORM.                    "PF_STATUS
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
        EXPORTING
          i_callback_program       = repid
          i_callback_user_command  = 'USER_COMMAND'
          i_callback_pf_status_set = 'PF_STATUS'
          is_layout                = layout
          it_fieldcat              = fieldcat
          it_excluding             = pf_exclude
        TABLES
          t_outtab                 = itab
        EXCEPTIONS
          OTHERS                   = 0.
            FORM user_command  USING r_ucomm LIKE sy-ucomm
                                       rs_selfield TYPE slis_selfield.
    ENDFORM.
    Please reward points if found helpful.

  • How to ADD Materialized Views to Refresh Group

    Hi,
    My requirement is, i want to refresh MVs(fast refresh only) by using DBMS_SCHEDULER. For this i have created one DBMS_SCHEDULER job like below.
    BEGIN
    DBMS_SCHEDULER.CREATE_JOB (
    JOB_NAME      => 'REFRESH_MV_UPLOAD',
    JOB_TYPE           => 'PLSQL_BLOCK',
    JOB_ACTION      => 'DBMS_REFRESH.REFRESH('MV_UPLOAD_GRP');',
    REPEAT_INTERVAL      => 'FREQ=MINUTELY; INTERVAL=30',
    ENABLED      => TRUE
    END;
    In the above script, i created one refresh group 'MV_UPLOAD_GRP'. So what my requirement is i want to ADD my MVs refresh scripts to this group. Scripts as below...
    Refresh MV Scripts:
    1) Exec dbms_mview.refresh('emp.entity', 'f');
    2) Exec dbms_mview.refresh('emp.identifier', 'f');
    3) Exec dbms_mview.refresh('emp.rating_hist', 'f');
    . so on.
    Can anyboy help me how to add these scripts to refresh group 'MV_UPLOAD_GRP'.
    Regards
    Raj

    ALL_REFRESH and ALL_REFRESH_CHILDREN
    http://download.oracle.com/docs/cd/B19306_01/server.102/b14227/rarsnapviews.htm#REPMA027
    Nicolas.

  • How to make at startup script that fits spread on open

    Hi there,
    Does anyone know how to make a startup script for InD CS6 that fit spread too screen when document open?
    I've tried this and it works but I've get a dialog that says "Object is not valid":
    #targetengine "session"
    main();
    function main(){
    var myEventListener = app.eventListeners.add("afterOpen", excuteScript);
    function excuteScript(){
    var myD = app.documents[0];
    app.layoutWindows[0].zoom(ZoomOptions.FIT_SPREAD);

    Hi Jump_Over and thank's for reply.
    I'm a total newbie when it comes to scripting.
    Can you show me how you mean?
    Jonas

  • How to specify the webLogic server startup script to use different config.xml  file ??

    Hi,
    I have 2 weblogic startup scripts (startWebLogic.sh and
    startWebLogic_recovery.sh) for the same domain.
    startWebLogic.sh uses config.xml file.
    I would like to use config_recovery.xml as the configuration file for startWebLogic_recovery.sh
    How would I do this ?
    I am using WebLogic Server 6.1 on SunOS 5.8 / HP-UX 11.0.
    Appreciate any help.
    Regards
    Gunaseelan Venkateswaran

    I guess you're using Weblogic 6.1 with WLCS 3.5. I think you're supposed to work with one config.xml for the same domain, and not have a different config.xml.
    To start up different applications or EJBs, use the "target" property to control which applications to start up for the particular instance.
    YY

  • How to add a page in the SAP Scripts

    Hi All,
    I want to know how to add a page in the sap scripts. there is already sap script developed by some other person.
    Now I have to add a page in front of that and have to add some more data.I added a page in page windows but thats not at all working.
    Please help me out in this.
    Thanks,
    Praveen

    new page will create in sap scripts using new page command.
    you have to set condition like after some number of records displayed in page new page has to be trigger.
    ex:YOU HAVE SO MANY RECORDS FOR PRINTING BUT YOU WANT TO DISPLAY 100 RECORDS IN FIRST PAGE REMAINING IN SECOND PAGE LIKE THAT.
    Here you can use NEW PAGE COMMAND .
    IT IS OPPOSITE PURPOSE OF PROTECT AND ENDPOTECT.
    Reward if useful.

  • How to add a report into the SAP-SCRIPT .using PERFORM ......ENDPERFORM

    My question is that How to add a report into the SAP-SCRIPT .
    by using PERFORM ......ENDPERFORM
    I don't know how to used it .

    Hi Sandeep,
    Please check this link
    http://help.sap.com/saphelp_40b/helpdata/en/d1/803279454211d189710000e8322d00/content.htm
    http://www.allinterview.com/showanswers/37425.html
    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.
    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 (u2018First pageu2019, u2018Next pageu2019, u2018Last pageu2019) 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 u2018PAGEu2019.
    CHECK SY-SUBRC = 0.
    PAGNUM = IN_PAR-VALUE.
    READ TABLE IN_PAR WITH KEY u2018NEXTPAGEu2019.
    CHECK SY-SUBRC = 0.
    NEXTPAGE = IN_PAR-VALUE.
    READ TABLE IN_PAR WITH KEY u2018BARCODEu2019.
    CHECK SY-SUBRC = 0.
    IF PAGNUM = 1.
    OUT_PAR-VALUE = u2018|u2019. "First page
    ELSE.
    OUT_PAR-VALUE = u2018||u2019. "Next page
    ENDIF.
    IF NEXTPAGE = 0.
    OUT_PAR-VALUE+2 = u2018Lu2019. "Flag: last page
    ENDIF.
    MODIFY OUT_PAR INDEX SY-TABIX.
    ENDFORM.
    Best regards,
    raam

  • Group Policy - Computer Startup Scripts - Add/Set Default printer

    Good Morning.
    Let's say we have 2 offices, A and B, and only 1 user.  The user is using Roaming Profiles.  Each office has its own printer.
    What I am trying to do, is make a Startup script that is specific to the COMPUTER being logged into so when any user logs into that computer, they get the printer in that office defined and set as default.
    I am able to do this successfully with my script but ONLY if i have the script be on the USER side of GP (i.e. in the Logon script section)
    That is great that that is working however, when my user goes to Office B, they still get mapped to Office A's printer if I use that method.
    So I figured I could just modify my GP and run the same script from the STARTUP section of the computer, rather than the LOGON section of the user.  It does not work.
    Here is my script:
    Set WRFCUNetwork = CreateObject("Wscript.Network")
    PrinterPath = "\\fileserver\MAINTELLER"
    PrinterDriver = "PrinterDriver"
    WRFCUNetwork.AddWindowsPrinterConnection PrinterPath, PrinterDriver
    WRFCUNetwork.SetDefaultPrinter "\\fileserver\MAINTELLER"
    This is where I Have the script placed:
         Computer Configuration -> Windows Settings -> Scripts(Startup/Shutdown)
    Once i'm in there, I double click Startup, click Add, and select my script which is named:
         MainPrinterSetup.vbs
    I have this GP applied to ONE OU, and that OU has ONE computer in it (my test computer)
    I login with a brand new user called "testuser" (creative, huh?) and basically nothing happens
    except they log in and have some Microsoft Document Image Writer printer set as default (which by the way sure does slow the PC down to the point of it almost being broke if anyone actually tries to print to that by accident)
    No Main Teller Printer, no anything.
    The strangest part about this is, if i apply this script to the user LOGON scripts, it works fine, the printer is there, and is set as default. (but see above why that wont work for my situation)
    So obviously the script works fine, but I guess i'm missing something when it comes to applying GP's to Computers rather than Users.
    Can anyone shed some light as to why the script is not running (i'm guessing the script isn't even attempting to run, rather than failing, but i have no way to know that)
    Thank you in advance!!
    Derek Conlon
    Network Administrator
    WRFCU
    EDIT:  Here are the PC's info that i'm working on:
         Server:  Windows Server 2003 Standard Edition (where my GP's are created and managed with AD)
         Target PC:  Windows XP Professional SP3
    EDIT #2:  I manually navigated to the Script file after logging in and "opened" it and it added and set the default printer no problem.  the issue is definately with the script running at startup.

    I wanted to clarify a few things:
    1. While it is true that printer connections are usually per user, it is definitely possible to create "global printers".  There are a number of ways to do this, but two methods that come to mind are using:
    a. "Rundll32 printui.dll,PrintUIEntry" option with the "/ga" switch.  The "/ga" switch is the key here since it allows you to deploy printers "per machine" instead of "per user".  More information
    about this is available at:
    http://members.shaw.ca/bsanders/NetPrinterAllUsers.htm
    http://technet.microsoft.com/en-us/library/ee624057%28WS.10%29.aspx
    http://www.computerperformance.co.uk/Logon/logon_printer_computer.htm
    http://www.robvanderwoude.com/2kprintcontrol.php
    b. The Print Management console that is available in Windows 2003 R2 and higher can help you deploy printers "per machine" in addition to "per user".  More information about this is available at:
    http://www.czsolution.com/print-management/print-management/print-management-console.htm#DeployingPrintersByGroupPolicy
    http://technet.microsoft.com/en-us/library/cc753109%28WS.10%29.aspx
    2. As Guy mentioned, Group Policy Preferences can help set the default printer.  But there is another way to accomplish this.  The problem with the computer startup portion is that it runs before the user logs in.  And applying this script
    in the login script section would not work per computer unless you used loopback processing.  So another way to do this is to place a script that sets the default printer into the "All Users" startup folder.  Items in the "All Users"
    startup folder run for any user that logs into the computer, but it runs in the user's context.  So, this script would effectively set the default printer on a "per machine" basis.  The script method is a cruder way to approach the problem,
    but it will help get the job done.  Here are some resources on setting the default printer via script:
    http://www.intelliadmin.com/index.php/2007/08/set-default-printer-from-a-script
    http://www.computerperformance.co.uk/ezine/ezine17.htm

Maybe you are looking for

  • Logs are not getting displayed in R/3 for Transaction code NPRT

    After doing the initiallisation of setup tables in R/3 for application component 08 (shipment) I am unable to see the log for this init in NPRT but it is pulling the records because I have checked in SE16N and  RSA3 .Let me know if can has got a solu

  • My iPhone 4 can not be read by my JVC car radio after upgrading to 5.0

    My iPhone 4 has always worked with my jvc radio until I went to 5.0 radio just says cannot read and phone says cannot playI whish Apple would fix this problem.

  • Problem w/ HP 2575 after upgrade to Snow Leopard

    Upgraded to Snow Leopard last weekend. My HP Photosmart 2575 works fine with the Mac via the USB, but now is "not found" on the wireless network when my kids try to print from their PC (I know, switch them to a Mac - not happening right now!). The pr

  • Attachment to received email not shown at all in Mail

    I am using Mail and Safari on my Mac Mini with OS 10.8.5 (Mountain Lion). My email provider and ISP is BT/Yahoo! I received an email that had been written on and sent from an iPad. It was supposed to contain a one-page MS Word (.docx) text file as an

  • FLASHBACK OFF FOR UNDO TABLESPACE????

    Hi all As my Undo tablespace growing evryday 2 GB & NOW it reached 19, Database size is 6GB only using Oracle 10g Release 2 without patch Set (release 1002000100) on Hp-Unix OS Can i use the Undo tablespace with FLASHBACK OFF option? what are the Con