Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6114131
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T14:56:20+00:00 2026-05-23T14:56:20+00:00

#!/bin/sh exec node /opt/nodejs/first/app.js 1>>/opt/nodejs/first/log/output 2>>/opt/nodejs/first/log/error This shell script throws an error: exec: 2:

  • 0
#!/bin/sh
exec node /opt/nodejs/first/app.js 1>>/opt/nodejs/first/log/output 2>>/opt/nodejs/first/log/error

This shell script throws an error:

exec: 2: node: not found

I’m trying to launch it on system boot:

sudo update-rc.d autostart.sh defaults 95

I’m doing something wrong?

Maybe boot level is wrong or order number, or something else?

Thanks 😉

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T14:56:20+00:00Added an answer on May 23, 2026 at 2:56 pm

    You need to set your PATH environment variable to include the directory where your node binary lives. For starting on boot, what OS are you running? I suggest Ubuntu where you can use the upstart system. Here’s a simple upstart script to make a node server work as a daemon.

    description "start and stop your node.js server"
    version "1.0"
    author "You <you@yoursite.example>"
    
    start on startup
    respawn
    
    env NODE_ENV=production
    env PATH=/path/to/node/bin
    chdir /path/to/your/app/root
    exec su -c 'node app/server.js' www-data  >> var/log/stdout.log 2>&1
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've got a script like: #!/bin/bash exec /usr/bin/some_binary > /tmp/my.log 2>&1 Problem is that
Obviously this shell script is calling itself as a Python script: #!/bin/sh ## repo
You can run a scala script as a linux shell script: #!/bin/sh exec scala
bash shell: ./mimic_cmd startDaemon() Corresponding Ant code: <exec failonerror=true executable=/bin/mimic_cmd> <arg value='startDaemon()' /> </exec>
I've this code in my build.xml: <exec executable=cmd osfamily=winnt> <arg value=/c/> <arg value=xsltproc\bin\xsltproc.exe/> <arg
Suppose a shell script (/bin/sh or /bin/bash) contained several commands. How can I cleanly
I have created an upstart script in order to daemonize juggernaut (a node.js app)
#!/bin/sh exec /usr/local/cpanel/cgi-sys/php5 this command is in a file called php.fcgi . i don't
#!/bin/csh -x exec bash source ~arovit/RTM_test/unit_RTM/fail.10/failure.001.sh exec csh <script continues...> is there any other
I'm using this to convert a PDF to PNG: exec('/usr/bin/convert -density 96 -quality 85

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.