Startup script on Debian 8 (Jessie) with etherwake won't workMigrate socat init script to systemdDebian...

Radix2 Fast Fourier Transform implemented in C++

Has there ever been a truly bilingual country prior to the contemporary period?

Metal that glows when near pieces of itself

What allows us to use imaginary numbers?

Does Paul ever actually quote Jesus anywhere as a primary source?

show two plots together: a two dimensional curve tangent to the maxima of a three dimensional plot

Programming a recursive formula into Mathematica and find the nth position in the sequence

Spongy green glass found on graves

Does == actually work the same or different when comparing two primitives vs two Objects in Java?

How to train a replacement without them knowing?

Eric Andre had a dream

How could Tony Stark wield the Infinity Nano Gauntlet - at all?

What exactly happened to the 18 crew members who were reported as "missing" in "Q Who"?

Rotate List by K places

Which basis does the wavefunction collapse to?

How to detect a failed AES256 decryption programmatically?

Including a real event in a story

Why should I pay for an SSL certificate?

Does the Temple of the Gods spell nullify critical hits?

Polar contour plot in Mathematica?

Postdoc interview - somewhat positive reply but no news?

Installing certbot - error - "nothing provides pyparsing"

Why is su world executable?

Adding things to bunches of things vs multiplication



Startup script on Debian 8 (Jessie) with etherwake won't work


Migrate socat init script to systemdDebian (jessie) with XFCE, Sessions and Startup: Application AutostartMinecraft server startup/shutdown with systemdDebian startup script doesn't startMissing service file for pure-ftpdFailed to start MariaDB database server after upgrade to debian 9systemd: finish the execution of custom shell script before starting nginxDebian Stretch LVM new partiton or volume **Now ssl keys fragged** gui won't load






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ margin-bottom:0;
}







3















I'm attempting to remotely wake a slave machine when the master boots up through a bash script using the etherwake command to send magic packets. Both OSs are Debian 8. The full code is written below:



/etc/init.d/etherwake



#!/bin/sh
#/etc/init.d/etherwake

### BEGIN INIT INFO
# Provides: etherwake
# Required-Start: $all
# Required-Stop: $local_fs $remote_fs $network $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Start etherwake at boot time
# Description: Enable service provided by etherwake.
### END INIT INFO

ETHERWAKE=/usr/sbin/etherwake

case "$1" in

start)
echo "Booting slaves through etherwake..."
$ETHERWAKE <MAC Address>
echo "Finished booting all slaves."
;;

stop)
echo "Stop not implemented. Doing nothing"
;;

restart|force-reload)
$0 stop
sleep 10
$0 start
;;

*)
echo "Usage: /etc/init.d/etherwake {start}"
exit 1
;;
esac

exit 0


After writing the script, I did:




  1. chmod 755 /etc/init.d/etherwake

  2. update-rc.d etherwake defaults

  3. Reboot the system through shutdown -r now


I've also tried using /etc/rc.local in 3 different ways:



/etc/rc.local



#!/bin/sh -e
#
# rc.local

/etc/init.d/etherwake
etherwake <MAC Address>
/usr/sbin/etherwake <MAC Address>
exit 0


No luck whatsoever. When I run either /etc/rc.local or /etc/init.d/etherwake manually as root, everything works nicely. I thought it could be something with the permissions but as far as I read any script on /etc/init.d runs as root by default. What am I doing wrong?



Thanks in advance.





Edit:



I understand Debian 8 uses systemd instead of sysvinit. After setting everything upsystemctl -l status etherwake.service gives me:



● etherwake.service - Etherwake magic packet service
Loaded: loaded (/etc/systemd/system/etherwake.service; enabled)
Active: inactive (dead) since Fri 2016-09-30 16:30:56 BRT; 1min 33s ago
Process: 824 ExecStart=/etc/init.d/etherwake start (code=exited, status=0/SUCCESS)
Main PID: 824 (code=exited, status=0/SUCCESS)

Sep 30 16:30:56 hostname etherwake[824]: Booting slaves through etherwake...
Sep 30 16:30:56 hostname etherwake[824]: Finished booting all slaves.


And /etc/systemd/system/etherwake.service is:



[Unit]
Description=Etherwake magic packet service
Wants=network-online.target
After=syslog.service network.target network-online.target

[Service]
ExecStart=/etc/init.d/etherwake start

[Install]
WantedBy=default.target


Another thing I noticed is that running systemctl restart etherwake works as a charm.










share|improve this question

















bumped to the homepage by Community 2 days ago


This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.

















  • Can you edit your question to add the output of systemctl -l status etherwake.service?

    – Steven Monday
    Sep 30 '16 at 16:07











  • Done. @StevenMonday

    – Gabriel Rebello
    Sep 30 '16 at 18:58











  • I'd guess your unit is somehow being run before the network is really up. You might be able to tell from the full log (e.g., journalctl -b).

    – derobert
    Mar 9 '17 at 16:26


















3















I'm attempting to remotely wake a slave machine when the master boots up through a bash script using the etherwake command to send magic packets. Both OSs are Debian 8. The full code is written below:



/etc/init.d/etherwake



#!/bin/sh
#/etc/init.d/etherwake

### BEGIN INIT INFO
# Provides: etherwake
# Required-Start: $all
# Required-Stop: $local_fs $remote_fs $network $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Start etherwake at boot time
# Description: Enable service provided by etherwake.
### END INIT INFO

ETHERWAKE=/usr/sbin/etherwake

case "$1" in

start)
echo "Booting slaves through etherwake..."
$ETHERWAKE <MAC Address>
echo "Finished booting all slaves."
;;

stop)
echo "Stop not implemented. Doing nothing"
;;

restart|force-reload)
$0 stop
sleep 10
$0 start
;;

*)
echo "Usage: /etc/init.d/etherwake {start}"
exit 1
;;
esac

exit 0


After writing the script, I did:




  1. chmod 755 /etc/init.d/etherwake

  2. update-rc.d etherwake defaults

  3. Reboot the system through shutdown -r now


I've also tried using /etc/rc.local in 3 different ways:



/etc/rc.local



#!/bin/sh -e
#
# rc.local

/etc/init.d/etherwake
etherwake <MAC Address>
/usr/sbin/etherwake <MAC Address>
exit 0


No luck whatsoever. When I run either /etc/rc.local or /etc/init.d/etherwake manually as root, everything works nicely. I thought it could be something with the permissions but as far as I read any script on /etc/init.d runs as root by default. What am I doing wrong?



Thanks in advance.





Edit:



I understand Debian 8 uses systemd instead of sysvinit. After setting everything upsystemctl -l status etherwake.service gives me:



● etherwake.service - Etherwake magic packet service
Loaded: loaded (/etc/systemd/system/etherwake.service; enabled)
Active: inactive (dead) since Fri 2016-09-30 16:30:56 BRT; 1min 33s ago
Process: 824 ExecStart=/etc/init.d/etherwake start (code=exited, status=0/SUCCESS)
Main PID: 824 (code=exited, status=0/SUCCESS)

Sep 30 16:30:56 hostname etherwake[824]: Booting slaves through etherwake...
Sep 30 16:30:56 hostname etherwake[824]: Finished booting all slaves.


And /etc/systemd/system/etherwake.service is:



[Unit]
Description=Etherwake magic packet service
Wants=network-online.target
After=syslog.service network.target network-online.target

[Service]
ExecStart=/etc/init.d/etherwake start

[Install]
WantedBy=default.target


Another thing I noticed is that running systemctl restart etherwake works as a charm.










share|improve this question

















bumped to the homepage by Community 2 days ago


This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.

















  • Can you edit your question to add the output of systemctl -l status etherwake.service?

    – Steven Monday
    Sep 30 '16 at 16:07











  • Done. @StevenMonday

    – Gabriel Rebello
    Sep 30 '16 at 18:58











  • I'd guess your unit is somehow being run before the network is really up. You might be able to tell from the full log (e.g., journalctl -b).

    – derobert
    Mar 9 '17 at 16:26














3












3








3








I'm attempting to remotely wake a slave machine when the master boots up through a bash script using the etherwake command to send magic packets. Both OSs are Debian 8. The full code is written below:



/etc/init.d/etherwake



#!/bin/sh
#/etc/init.d/etherwake

### BEGIN INIT INFO
# Provides: etherwake
# Required-Start: $all
# Required-Stop: $local_fs $remote_fs $network $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Start etherwake at boot time
# Description: Enable service provided by etherwake.
### END INIT INFO

ETHERWAKE=/usr/sbin/etherwake

case "$1" in

start)
echo "Booting slaves through etherwake..."
$ETHERWAKE <MAC Address>
echo "Finished booting all slaves."
;;

stop)
echo "Stop not implemented. Doing nothing"
;;

restart|force-reload)
$0 stop
sleep 10
$0 start
;;

*)
echo "Usage: /etc/init.d/etherwake {start}"
exit 1
;;
esac

exit 0


After writing the script, I did:




  1. chmod 755 /etc/init.d/etherwake

  2. update-rc.d etherwake defaults

  3. Reboot the system through shutdown -r now


I've also tried using /etc/rc.local in 3 different ways:



/etc/rc.local



#!/bin/sh -e
#
# rc.local

/etc/init.d/etherwake
etherwake <MAC Address>
/usr/sbin/etherwake <MAC Address>
exit 0


No luck whatsoever. When I run either /etc/rc.local or /etc/init.d/etherwake manually as root, everything works nicely. I thought it could be something with the permissions but as far as I read any script on /etc/init.d runs as root by default. What am I doing wrong?



Thanks in advance.





Edit:



I understand Debian 8 uses systemd instead of sysvinit. After setting everything upsystemctl -l status etherwake.service gives me:



● etherwake.service - Etherwake magic packet service
Loaded: loaded (/etc/systemd/system/etherwake.service; enabled)
Active: inactive (dead) since Fri 2016-09-30 16:30:56 BRT; 1min 33s ago
Process: 824 ExecStart=/etc/init.d/etherwake start (code=exited, status=0/SUCCESS)
Main PID: 824 (code=exited, status=0/SUCCESS)

Sep 30 16:30:56 hostname etherwake[824]: Booting slaves through etherwake...
Sep 30 16:30:56 hostname etherwake[824]: Finished booting all slaves.


And /etc/systemd/system/etherwake.service is:



[Unit]
Description=Etherwake magic packet service
Wants=network-online.target
After=syslog.service network.target network-online.target

[Service]
ExecStart=/etc/init.d/etherwake start

[Install]
WantedBy=default.target


Another thing I noticed is that running systemctl restart etherwake works as a charm.










share|improve this question
















I'm attempting to remotely wake a slave machine when the master boots up through a bash script using the etherwake command to send magic packets. Both OSs are Debian 8. The full code is written below:



/etc/init.d/etherwake



#!/bin/sh
#/etc/init.d/etherwake

### BEGIN INIT INFO
# Provides: etherwake
# Required-Start: $all
# Required-Stop: $local_fs $remote_fs $network $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Start etherwake at boot time
# Description: Enable service provided by etherwake.
### END INIT INFO

ETHERWAKE=/usr/sbin/etherwake

case "$1" in

start)
echo "Booting slaves through etherwake..."
$ETHERWAKE <MAC Address>
echo "Finished booting all slaves."
;;

stop)
echo "Stop not implemented. Doing nothing"
;;

restart|force-reload)
$0 stop
sleep 10
$0 start
;;

*)
echo "Usage: /etc/init.d/etherwake {start}"
exit 1
;;
esac

exit 0


After writing the script, I did:




  1. chmod 755 /etc/init.d/etherwake

  2. update-rc.d etherwake defaults

  3. Reboot the system through shutdown -r now


I've also tried using /etc/rc.local in 3 different ways:



/etc/rc.local



#!/bin/sh -e
#
# rc.local

/etc/init.d/etherwake
etherwake <MAC Address>
/usr/sbin/etherwake <MAC Address>
exit 0


No luck whatsoever. When I run either /etc/rc.local or /etc/init.d/etherwake manually as root, everything works nicely. I thought it could be something with the permissions but as far as I read any script on /etc/init.d runs as root by default. What am I doing wrong?



Thanks in advance.





Edit:



I understand Debian 8 uses systemd instead of sysvinit. After setting everything upsystemctl -l status etherwake.service gives me:



● etherwake.service - Etherwake magic packet service
Loaded: loaded (/etc/systemd/system/etherwake.service; enabled)
Active: inactive (dead) since Fri 2016-09-30 16:30:56 BRT; 1min 33s ago
Process: 824 ExecStart=/etc/init.d/etherwake start (code=exited, status=0/SUCCESS)
Main PID: 824 (code=exited, status=0/SUCCESS)

Sep 30 16:30:56 hostname etherwake[824]: Booting slaves through etherwake...
Sep 30 16:30:56 hostname etherwake[824]: Finished booting all slaves.


And /etc/systemd/system/etherwake.service is:



[Unit]
Description=Etherwake magic packet service
Wants=network-online.target
After=syslog.service network.target network-online.target

[Service]
ExecStart=/etc/init.d/etherwake start

[Install]
WantedBy=default.target


Another thing I noticed is that running systemctl restart etherwake works as a charm.







shell-script debian startup wake-on-lan






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Feb 27 '17 at 11:14









Stephen Kitt

200k27 gold badges473 silver badges544 bronze badges




200k27 gold badges473 silver badges544 bronze badges










asked Sep 30 '16 at 14:12









Gabriel RebelloGabriel Rebello

1162 bronze badges




1162 bronze badges






bumped to the homepage by Community 2 days ago


This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.









bumped to the homepage by Community 2 days ago


This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.







bumped to the homepage by Community 2 days ago


This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.















  • Can you edit your question to add the output of systemctl -l status etherwake.service?

    – Steven Monday
    Sep 30 '16 at 16:07











  • Done. @StevenMonday

    – Gabriel Rebello
    Sep 30 '16 at 18:58











  • I'd guess your unit is somehow being run before the network is really up. You might be able to tell from the full log (e.g., journalctl -b).

    – derobert
    Mar 9 '17 at 16:26



















  • Can you edit your question to add the output of systemctl -l status etherwake.service?

    – Steven Monday
    Sep 30 '16 at 16:07











  • Done. @StevenMonday

    – Gabriel Rebello
    Sep 30 '16 at 18:58











  • I'd guess your unit is somehow being run before the network is really up. You might be able to tell from the full log (e.g., journalctl -b).

    – derobert
    Mar 9 '17 at 16:26

















Can you edit your question to add the output of systemctl -l status etherwake.service?

– Steven Monday
Sep 30 '16 at 16:07





Can you edit your question to add the output of systemctl -l status etherwake.service?

– Steven Monday
Sep 30 '16 at 16:07













Done. @StevenMonday

– Gabriel Rebello
Sep 30 '16 at 18:58





Done. @StevenMonday

– Gabriel Rebello
Sep 30 '16 at 18:58













I'd guess your unit is somehow being run before the network is really up. You might be able to tell from the full log (e.g., journalctl -b).

– derobert
Mar 9 '17 at 16:26





I'd guess your unit is somehow being run before the network is really up. You might be able to tell from the full log (e.g., journalctl -b).

– derobert
Mar 9 '17 at 16:26










1 Answer
1






active

oldest

votes


















0














The problem is that update-rc.d etherwake defaults maybe don't work. Try to enable service via systemctl, run:



systemctl enable etherwake





share|improve this answer




























    Your Answer








    StackExchange.ready(function() {
    var channelOptions = {
    tags: "".split(" "),
    id: "106"
    };
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function() {
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled) {
    StackExchange.using("snippets", function() {
    createEditor();
    });
    }
    else {
    createEditor();
    }
    });

    function createEditor() {
    StackExchange.prepareEditor({
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: false,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: null,
    bindNavPrevention: true,
    postfix: "",
    imageUploader: {
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    },
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    });


    }
    });














    draft saved

    draft discarded


















    StackExchange.ready(
    function () {
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f313451%2fstartup-script-on-debian-8-jessie-with-etherwake-wont-work%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    0














    The problem is that update-rc.d etherwake defaults maybe don't work. Try to enable service via systemctl, run:



    systemctl enable etherwake





    share|improve this answer






























      0














      The problem is that update-rc.d etherwake defaults maybe don't work. Try to enable service via systemctl, run:



      systemctl enable etherwake





      share|improve this answer




























        0












        0








        0







        The problem is that update-rc.d etherwake defaults maybe don't work. Try to enable service via systemctl, run:



        systemctl enable etherwake





        share|improve this answer













        The problem is that update-rc.d etherwake defaults maybe don't work. Try to enable service via systemctl, run:



        systemctl enable etherwake






        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Mar 24 '17 at 12:38









        DanielDaniel

        3935 silver badges15 bronze badges




        3935 silver badges15 bronze badges

































            draft saved

            draft discarded




















































            Thanks for contributing an answer to Unix & Linux Stack Exchange!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid



            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.


            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f313451%2fstartup-script-on-debian-8-jessie-with-etherwake-wont-work%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            Hudson River Historic District Contents Geography History The district today Aesthetics Cultural...

            The number designs the writing. Feandra Aversely Definition: The act of ingrafting a sprig or shoot of one...

            Ayherre Geografie Demografie Externe links Navigatiemenu43° 23′ NB, 1° 15′ WL43° 23′ NB, 1°...