Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

4
  • Is it because /usr/sbin is in your interactive environment but not cron’s? Commented Jun 14, 2018 at 17:58
  • Hi @JeffSchaller, no idea.. that's why i'm asking :) Commented Jun 15, 2018 at 9:14
  • I think you should see if that popen call is successful. Maybe also use the full path to the service command. Commented Jun 15, 2018 at 9:21
  • @JeffSchaller You were close, see the answer Commented Jun 15, 2018 at 9:22