[solved] Unable to restart a service via scheduled jobs / Inappropriate ioctl for device

    • OMV 4.x
    • Resolved
    • [solved] Unable to restart a service via scheduled jobs / Inappropriate ioctl for device

      In the past I had issues with the FTP service, obviously a problem nobody could figure out. I did find a workaround, though - but now that doesn't work anymore.
      I'm trying to restart a service - namely proftpd - via scheduled jobs once a day. The way I have tried to do so is via a direct command or by executing a shell script. When running the job manually, both ways work perfectly fine, but when triggered at the specified time, both will fail, the error message reads:

      Source Code

      1. mesg: ttyname failed: Inappropriate ioctl for device

      Here's the command:


      And here's the call for the script:


      The script itself is very simple, here are it's entire contents:

      Shell-Script

      1. #!/bin/sh
      2. service proftpd restart

      I have searched around for "Inappropriate ioctl for device" with several hits, but I just can't figure out, how to solve the issue here. As said, when I execute either option manually on the scheduled jobs page, they work absolutely fine, ftp will immediately restart.

      The post was edited 1 time, last by KOENICH ().

    • I never run commands directly in cron jobs. And I assume OMV use cron behind the curtains. Instead I run commands from scripts, something like this:

      cd folder_where_the_command_should_run && /bin/bash /full/path/and/name/of/script.sh

      It seems that otherwise the environment can be different from when you run a command manually. Usually it doesn't matter, but sometimes it does... This way the script runs exactly(?) the same as if launched from the command line.

      I add cron jobs by adding lines to /etc/crontab
      OMV 4: 9 x Odroid HC2 + 1 x Odroid HC1 + 1 x Raspberry Pi 4

      The post was edited 1 time, last by Adoby ().

    • Adoby wrote:

      I never run commands directly in cron jobs. And I assume OMV use cron behind the curtains. Instead I run commands from scripts, something like this:

      cd folder_where_the_command_should_run && /bin/bash /full/path/and/name/of/script.sh

      It seems that otherwise the environment can be different from when you run a command manually. Usually it doesn't matter, but sometimes it does... This way the script runs exactly(?) the same as if launched from the command line.

      I add cron jobs by adding lines to /etc/crontab
      Thanks - but isn't that exactly what I did with my second option of running a script?
      Or should I change some of the syntax?
      Again, when executed manually in OMV, it does work...
    • I know I have read that thread before - and thought the problem didn't apply to me, because "it simply creates an annoying output, nothing more." which was not true in my case - since the service didn't restart.
      It seems I never tried to edit /root/.profile as suggested, but now did after your suggestion... and it seems to work. I didn't receive any error message by e-mail and I can see in the logs proftp did indeed restart.
      Hooray! Thanks a lot!!
    • Users Online 1

      1 Guest