Python-Script for Autostart, what is the best way?

  • Hi,


    I've got a running Python-Script for recording VoIP-Calls from my Fritzbox (legal-issues etc are clear; those who call on that special number know about the recording).


    As my Computer (currently running the script) is not on "always on" anymore, I wanted to move that script over to my OMV-Installation.


    As I have to "operate on the open heart", I'd like to ask experienced user on how to get the script running (without ruining the current installation)...


    Plan:
    python-script starts automaticly.


    Problem:
    I'd like to avoid any init.d-solutions as these might be overwritten by an upgrade/update/systemchange.
    ...what is the best solution to get the script running by startup?


    (sorry for asking so "thumb", I'm quiet absorbed by the reason why I have to record the calls)


    Thanks for your help!

    System:
    HP N54l - 4GB RAM - 64GB-SSD OMV, 2 x 1TB Seagate, 1 x 4TB WD Blue
    OMV 3.0.58 OMV-Extras 3

    • Offizieller Beitrag

    Why would init.d be overwritten? We use init script for lots of the python plugins.

    omv 7.0.5-1 sandworm | 64 bit | 6.8 proxmox kernel

    plugins :: omvextrasorg 7.0 | kvm 7.0.13 | compose 7.1.4 | k8s 7.1.0-3 | cputemp 7.0.1 | mergerfs 7.0.4


    omv-extras.org plugins source code and issue tracker - github - changelogs


    Please try ctrl-shift-R and read this before posting a question.

    Please put your OMV system details in your signature.
    Please don't PM for support... Too many PMs!

  • A few years ago, I lost "custom init.d"-Start-Scripts after an update...
    Don't want to take Chances (especially if there are "nicer" ways to do it)...

    System:
    HP N54l - 4GB RAM - 64GB-SSD OMV, 2 x 1TB Seagate, 1 x 4TB WD Blue
    OMV 3.0.58 OMV-Extras 3

    • Offizieller Beitrag

    I'd like to avoid any init.d-solutions as these might be overwritten by an upgrade/update/systemchange.
    ...what is the best solution to get the script running by startup?


    Init is the main core of start-up applications in Debian......for now


    You probably lost the script due to other reasons (maybe you use an identical name of an init for a package) . Never heard of init scripts "vaporizing" after an upgrade. It is safe put it there or use /etc/rc.local if you're still convinced that init doesn't like you.

  • @emsic


    ...only if you're using a Fritz!Fon-Device, and then only for 10 Minutes...
    Unfortunatly, the current messed up Situation requires longer calls...


    But if you have a way to let "fritzcap" running directly on the Fritzbox?


    @all


    Ok, thanks - I'll try to get it running with init...
    But it will have to wait for weekend...

    System:
    HP N54l - 4GB RAM - 64GB-SSD OMV, 2 x 1TB Seagate, 1 x 4TB WD Blue
    OMV 3.0.58 OMV-Extras 3

  • Hi again,


    Have to bring that topic up again, as I encountered an annoying issue:
    I created an Init.d-Script for the capture-script, the script starts - but can't connect to the fritzbox WHEN started at bootup... If I log in to ssh, and start the init.d-script by myself, everything is working fine.


    The script:


    Adding some test-parts to the init-script (a simple ip addr-string to show current IP-Adress) I found out, that during bootup, the init-script seems to be unable to use the network, eventhough I got is as depency... The script does get started, but the own log of the script shows just "cannot connect to fritzbox"...


    I'm running 2.1.18 - is it possible that it is using system.d already?
    Does anybody see the error in my script?
    (kinda annoying to have to log in to ssh and start the script by myself after a reboot)

    System:
    HP N54l - 4GB RAM - 64GB-SSD OMV, 2 x 1TB Seagate, 1 x 4TB WD Blue
    OMV 3.0.58 OMV-Extras 3

    • Offizieller Beitrag

    OMV 2 is not using system.d since it is still Debian Wheezy.


    Did you try $all in your required-start line? Is your system using a static IP? static IPs are much faster than dhcp.

    omv 7.0.5-1 sandworm | 64 bit | 6.8 proxmox kernel

    plugins :: omvextrasorg 7.0 | kvm 7.0.13 | compose 7.1.4 | k8s 7.1.0-3 | cputemp 7.0.1 | mergerfs 7.0.4


    omv-extras.org plugins source code and issue tracker - github - changelogs


    Please try ctrl-shift-R and read this before posting a question.

    Please put your OMV system details in your signature.
    Please don't PM for support... Too many PMs!

    • Offizieller Beitrag

    System is set for DHCP and has a static IP on the router? That is still slow because it is waiting on the router to give it an address even if it is static. Try setting the box to a static IP. Otherwise, call your script from Scheduled Tasks with time set to At Reboot.

    omv 7.0.5-1 sandworm | 64 bit | 6.8 proxmox kernel

    plugins :: omvextrasorg 7.0 | kvm 7.0.13 | compose 7.1.4 | k8s 7.1.0-3 | cputemp 7.0.1 | mergerfs 7.0.4


    omv-extras.org plugins source code and issue tracker - github - changelogs


    Please try ctrl-shift-R and read this before posting a question.

    Please put your OMV system details in your signature.
    Please don't PM for support... Too many PMs!

  • Setting to manual IP:
    worth a try, BUT:
    checking the issue, I also had a "wait with this script until an IP-Adress has been taken"-Brake in the script, didn't work either...


    Using with Scheduled Task, sorry, forgot to mention it: tryed that also, having the same issue...


    I'll give the manual IP-thing a try now... (hate to play around there on a headless-system ;)

    System:
    HP N54l - 4GB RAM - 64GB-SSD OMV, 2 x 1TB Seagate, 1 x 4TB WD Blue
    OMV 3.0.58 OMV-Extras 3

    • Offizieller Beitrag

    Well, if it is that picky about an IP, the python script should be fixed. Another workaround would be this or even add a wait command to wait 20 seconds or something.

    omv 7.0.5-1 sandworm | 64 bit | 6.8 proxmox kernel

    plugins :: omvextrasorg 7.0 | kvm 7.0.13 | compose 7.1.4 | k8s 7.1.0-3 | cputemp 7.0.1 | mergerfs 7.0.4


    omv-extras.org plugins source code and issue tracker - github - changelogs


    Please try ctrl-shift-R and read this before posting a question.

    Please put your OMV system details in your signature.
    Please don't PM for support... Too many PMs!

  • Manual-IP didn't work either, but stumbling over "if-up.d" while changing IP-Settings, I gave that a try...


    I created a bash-script to call the python-script (yes I'm kinda old school - could have called it directly), placed it in /etc/network/if-up.d , added executable-bit, (removed everything that-script-related from init.d) and rebooted...


    Seems to be working... Have to test it a few days (including rebooting)

    System:
    HP N54l - 4GB RAM - 64GB-SSD OMV, 2 x 1TB Seagate, 1 x 4TB WD Blue
    OMV 3.0.58 OMV-Extras 3

Jetzt mitmachen!

Sie haben noch kein Benutzerkonto auf unserer Seite? Registrieren Sie sich kostenlos und nehmen Sie an unserer Community teil!