Tag Info

New answers tagged

1

In systemd setups, reboot, poweroff, halt and init N all translate to various subcommands of systemctl. I'll be talking in terms of systemctl from now on. So, what happens when you issue (for example) a systemctl reboot command? Barring the polkit/logind abstraction layer (which is anyway not used when root privileges are available), this command translates ...


0

In your script you need to change the first line, the so called shebang, to #!/bin/bash and then you invoke the script like this:bash myscript.shBash is a superset of sh and is capable of the same actions and even more actions as sh.In cronjobs you should always use the bash command instead of the sh command.


1

Sensible troubleshooting procedure would be to simplify your script such that it unconditionally restarts firewall. Add that script to cron and determine if a simple, unconditional restart is working as expected. Assuming that works, add in your condition (the i [ mystery statement ] part) and try again. Without knowing what condition you are testing for, ...


4

The environment of cron is not the same as the environment of your random login shell. Most likely something in your environment is not what your firewall script needs it to be. Try checking /var/mail, or whatever your mail spool is. Cron defaults to mailing the output to the user whose crontab it executes something from, but if you haven't configured your ...


0

When you expect script to run from CRON, you need to define PATH to include location of service binary (usually located under /sbin) (or) give absolute path like /sbin/service firewall restart Also, can you share the output of below commands from your terminal session: # which service # bash -x <your-script-to-restart-fw> # strace -e process -f bash ...


1

What are you intending with some statement Extract if [ some statement ]; then ... That doesn't make sense


1

Your line ATT_BIN=/srv/web-asset-server-master/python server.py is setting variable ATT_BIN and then executing server.py. Normally, ATT_BIN should be a the full pathname to a single file to execute, for example /home/me/server.py, if that is where your python script is. Usually, server.py is changed so that the first line is, in your case: ...


0

The script must be invoked using sudo. Or by having another user in the the wheel administrator group account along with sudo. It all depends on what distro you are using with what options you can use and how to use them to run the script with high enough permissions. sudo -u [username] -S myscript.sh < password_file.txt When using a group account for ...


0

I have the same problem on a raspberry, my quick and dirty solution was update-rc.d disable abd I put service ssh start in my rc.local. maybe in your case a service ssh enable will help,...


0

I figured it out. As I posted in my other post: Is there a specific SSH boot log? In my auth.log file, it wasn't binding to the IP address I put in for the ListenAddress parameter in /etc/ssh/sshd_config. After I changed it back to 0.0.0.0, it starts up now. Don't quite understand, I thought I could put the IP address of my computer? And I don't understand ...


0

You have a readiness protocol mismatch. The Type of a service is important. That setting denotes what readiness protocol systemd expects the service to speak. A simple service is assumed to be immediately ready. A forking service is taken to be ready after its initial process forks a child and then exits. A dbus service is taken to be ready when a server ...


0

Assuming you have installed openssh-server , check for sshd startup symbolic links at /etc/rc{2,3,4,5} directories , run ls -l /etc/rc?.d/*ssh if no startup links there , create them by running sudo update-rc.d ssh defaults and reboot. If problem not solved yet, you may try it by placing service ssh start (before the "exit 0" line) at /etc/rc.local file ...


1

What if you do /etc/init.d/firewall restart instead of service firewall restart? It may be the path. Remember to make it executable: chmod +x myscript.sh


0

I found what were my problems... the main one is that zram is not by default handeled by systemd. As a consequence, there was no dev-zram0.device unit, so my services failed because of the unsatisfied dependencies. The solution was to add TAG+="systemd" to my udev rules There was another little error which was the line ExecStart in the daemon needed no ...



Top 50 recent answers are included