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 1092209
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T23:38:50+00:00 2026-05-16T23:38:50+00:00

I have a bash script which runs without needing to be root . But

  • 0

I have a bash script which runs without needing to be root.

But when I run it via shell_exec() (or system(), or exec()) like this:

return system("/home/tom/rrd/rrdtool-drawgraph.sh $interval $multiples - debug 2>&1;");

I get the following message:

sh: /home/tom/rrd/rrdtool-drawgraph.sh: Permission denied

(Strangely, the message is repeated. Not sure if that’s relevant? Edit: it doesn’t seem to repeat when I use backticks instead of shell_exec. Go figure.)

I’ve tried using 777 file permissions. I’ve tried changing the owner and group to www-data. I’ve changed the directory it spits its output into to have equally permissive permissions.

It still won’t run.

The only thing I can think of is that the script is in my home directory. If this is the problem, I’d be surprised (because my web root is also in my home directory), but I’m prepared to be corrected. If this is the issue, can I fix it without needing root priveliges?

If it’s not to do with being in my home directory, what is the problem? And how do I fix it?

  • 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-16T23:38:51+00:00Added an answer on May 16, 2026 at 11:38 pm

    Turns out it was because of the location of the scripts.

    I moved it all to /usr/share/rrdscripts and it works fine.

    Oddly enough, there isn’t a permissions issue with the output files: the script is still able to write to the output folder in my home directory.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Currently I have a bash script which runs the find command, like so: find
I have a bash script, that I run like this via the command line:
I have a BASH script which runs other commands and I would like to
I have a script which runs when the system boot first time. But that
I have small script in bash, which is generating graphs via gnuplot. Everything works
I have bash script which works well but when I send it back with
I have a bash script that runs (something like) the following command: vim -E
I have a bash script which calls another bash script, like so: #!/bin/bash echo
I have a bash script file which starts with a function definition, like this:
I have a bash script which I would like to handle spaces. I know

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.