Unable to run shell script on system start on mac?How to run a shell script on a Unix console or Mac terminal?Mac OS - add app to autostart with launchctlUsing scripts in PackageMaker (Mac OS X)How to start PostgreSQL server on Mac OS X?(OSX) launchctl not allowing Python to stopMy mac osx launched plist won't runMac OSX LaunchDaemon on Startup, Shell Script with SSHMAC OS Sierra - Run app at startup?launchctl process showing non-zero exit codelaunchctl cannot find bundle

I have found a mistake on someone's code published online: what is the protocol?

Why won't some unicode characters print to my terminal?

What details should I consider before agreeing for part of my salary to be 'retained' by employer?

May I use a railway velocipede on used British railways?

Why jet engines sound louder on the ground than inside the aircraft?

Why teach C using scanf without talking about command line arguments?

Why isn't a binary file shown as 0s and 1s?

Who determines when road center lines are solid or dashed?

Should I have shared a document with a former employee?

How do you send money when you're not sure it's not a scam?

What was the average temperature of space near the Spitzer Satellite Telescope?

Desecrating Shabbos to ask a Gadol to daven for a patient?

Word for something indicating the importance of guarding it properly

What causes a rotating object to rotate forever without external force—inertia, or something else?

Strategy to pay off revolving debt while building reserve savings fund?

Should I use a resistor between the gate driver and MOSFET (gate pin)?

"Je suis petite, moi?", purpose of the "moi"?

The most secure way to handle someone forgetting to verify their account?

Is surviving this (blood loss) scenario possible?

Is this Android phone Android 9.0 or Android 6.0?

Why do space operations use "nominal" to mean "working correctly"?

What happens if a company buys back all of its shares?

ANOVA or Linear Mixed Model?

Arithmetics in LuaLaTeX



Unable to run shell script on system start on mac?


How to run a shell script on a Unix console or Mac terminal?Mac OS - add app to autostart with launchctlUsing scripts in PackageMaker (Mac OS X)How to start PostgreSQL server on Mac OS X?(OSX) launchctl not allowing Python to stopMy mac osx launched plist won't runMac OSX LaunchDaemon on Startup, Shell Script with SSHMAC OS Sierra - Run app at startup?launchctl process showing non-zero exit codelaunchctl cannot find bundle






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








0















I want to run a shell script on mac startup. For that i have created a shell script and plist file. I have copied the plist to ~/Library/LaunchAgents/com.example.exampld.plist. It has all required permissions.



<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>com.example.exampld</string>
<key>ProgramArguments</key>
<array><string>/Users/dhiraj/.mydir/startup.sh</string></array>
<key>RunAtLoad</key>
<true/>
</dict>
</plist>


I have loaded it using below commond



sudo launchctl load -w ~/Library/LaunchAgents/com.example.exampld.plist


And also tested using



sudo launchctl start ~/Library/LaunchAgents/com.example.exampld.plist


But the shell script code is not executed i can say this because my shell script start a go build and open browser as below but nothing happens.



echo #start up go build#

$HOME/.mydir/./go
open http://localhost/sample/index.html









share|improve this question
























  • You haven't set a Program key so how will it know what to run? launchd.info

    – Mark Setchell
    Mar 26 at 10:10


















0















I want to run a shell script on mac startup. For that i have created a shell script and plist file. I have copied the plist to ~/Library/LaunchAgents/com.example.exampld.plist. It has all required permissions.



<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>com.example.exampld</string>
<key>ProgramArguments</key>
<array><string>/Users/dhiraj/.mydir/startup.sh</string></array>
<key>RunAtLoad</key>
<true/>
</dict>
</plist>


I have loaded it using below commond



sudo launchctl load -w ~/Library/LaunchAgents/com.example.exampld.plist


And also tested using



sudo launchctl start ~/Library/LaunchAgents/com.example.exampld.plist


But the shell script code is not executed i can say this because my shell script start a go build and open browser as below but nothing happens.



echo #start up go build#

$HOME/.mydir/./go
open http://localhost/sample/index.html









share|improve this question
























  • You haven't set a Program key so how will it know what to run? launchd.info

    – Mark Setchell
    Mar 26 at 10:10














0












0








0








I want to run a shell script on mac startup. For that i have created a shell script and plist file. I have copied the plist to ~/Library/LaunchAgents/com.example.exampld.plist. It has all required permissions.



<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>com.example.exampld</string>
<key>ProgramArguments</key>
<array><string>/Users/dhiraj/.mydir/startup.sh</string></array>
<key>RunAtLoad</key>
<true/>
</dict>
</plist>


I have loaded it using below commond



sudo launchctl load -w ~/Library/LaunchAgents/com.example.exampld.plist


And also tested using



sudo launchctl start ~/Library/LaunchAgents/com.example.exampld.plist


But the shell script code is not executed i can say this because my shell script start a go build and open browser as below but nothing happens.



echo #start up go build#

$HOME/.mydir/./go
open http://localhost/sample/index.html









share|improve this question
















I want to run a shell script on mac startup. For that i have created a shell script and plist file. I have copied the plist to ~/Library/LaunchAgents/com.example.exampld.plist. It has all required permissions.



<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>com.example.exampld</string>
<key>ProgramArguments</key>
<array><string>/Users/dhiraj/.mydir/startup.sh</string></array>
<key>RunAtLoad</key>
<true/>
</dict>
</plist>


I have loaded it using below commond



sudo launchctl load -w ~/Library/LaunchAgents/com.example.exampld.plist


And also tested using



sudo launchctl start ~/Library/LaunchAgents/com.example.exampld.plist


But the shell script code is not executed i can say this because my shell script start a go build and open browser as below but nothing happens.



echo #start up go build#

$HOME/.mydir/./go
open http://localhost/sample/index.html






macos launch launchctl






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Mar 26 at 10:03









Flimzy

43.4k13 gold badges71 silver badges109 bronze badges




43.4k13 gold badges71 silver badges109 bronze badges










asked Mar 26 at 9:00









Dhiraj KumarDhiraj Kumar

1,73215 gold badges51 silver badges131 bronze badges




1,73215 gold badges51 silver badges131 bronze badges












  • You haven't set a Program key so how will it know what to run? launchd.info

    – Mark Setchell
    Mar 26 at 10:10


















  • You haven't set a Program key so how will it know what to run? launchd.info

    – Mark Setchell
    Mar 26 at 10:10

















You haven't set a Program key so how will it know what to run? launchd.info

– Mark Setchell
Mar 26 at 10:10






You haven't set a Program key so how will it know what to run? launchd.info

– Mark Setchell
Mar 26 at 10:10













1 Answer
1






active

oldest

votes


















0














sudo launchctl load loads launchd agents/daemons in the local domain (/Library/..).



In the user domain you have to call launchctl without sudo






share|improve this answer






















    Your Answer






    StackExchange.ifUsing("editor", function ()
    StackExchange.using("externalEditor", function ()
    StackExchange.using("snippets", function ()
    StackExchange.snippets.init();
    );
    );
    , "code-snippets");

    StackExchange.ready(function()
    var channelOptions =
    tags: "".split(" "),
    id: "1"
    ;
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function()
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled)
    StackExchange.using("snippets", function()
    createEditor();
    );

    else
    createEditor();

    );

    function createEditor()
    StackExchange.prepareEditor(
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader:
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    ,
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    );



    );













    draft saved

    draft discarded


















    StackExchange.ready(
    function ()
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55353199%2funable-to-run-shell-script-on-system-start-on-mac%23new-answer', 'question_page');

    );

    Post as a guest















    Required, but never shown

























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    0














    sudo launchctl load loads launchd agents/daemons in the local domain (/Library/..).



    In the user domain you have to call launchctl without sudo






    share|improve this answer



























      0














      sudo launchctl load loads launchd agents/daemons in the local domain (/Library/..).



      In the user domain you have to call launchctl without sudo






      share|improve this answer

























        0












        0








        0







        sudo launchctl load loads launchd agents/daemons in the local domain (/Library/..).



        In the user domain you have to call launchctl without sudo






        share|improve this answer













        sudo launchctl load loads launchd agents/daemons in the local domain (/Library/..).



        In the user domain you have to call launchctl without sudo







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Mar 26 at 10:11









        vadianvadian

        167k19 gold badges185 silver badges206 bronze badges




        167k19 gold badges185 silver badges206 bronze badges


















            Got a question that you can’t ask on public Stack Overflow? Learn more about sharing private information with Stack Overflow for Teams.







            Got a question that you can’t ask on public Stack Overflow? Learn more about sharing private information with Stack Overflow for Teams.



















            draft saved

            draft discarded
















































            Thanks for contributing an answer to Stack Overflow!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid


            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.

            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55353199%2funable-to-run-shell-script-on-system-start-on-mac%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            Kamusi Yaliyomo Aina za kamusi | Muundo wa kamusi | Faida za kamusi | Dhima ya picha katika kamusi | Marejeo | Tazama pia | Viungo vya nje | UrambazajiKuhusu kamusiGo-SwahiliWiki-KamusiKamusi ya Kiswahili na Kiingerezakuihariri na kuongeza habari

            SQL error code 1064 with creating Laravel foreign keysForeign key constraints: When to use ON UPDATE and ON DELETEDropping column with foreign key Laravel error: General error: 1025 Error on renameLaravel SQL Can't create tableLaravel Migration foreign key errorLaravel php artisan migrate:refresh giving a syntax errorSQLSTATE[42S01]: Base table or view already exists or Base table or view already exists: 1050 Tableerror in migrating laravel file to xampp serverSyntax error or access violation: 1064:syntax to use near 'unsigned not null, modelName varchar(191) not null, title varchar(191) not nLaravel cannot create new table field in mysqlLaravel 5.7:Last migration creates table but is not registered in the migration table

            은진 송씨 목차 역사 본관 분파 인물 조선 왕실과의 인척 관계 집성촌 항렬자 인구 같이 보기 각주 둘러보기 메뉴은진 송씨세종실록 149권, 지리지 충청도 공주목 은진현