PROBLEM WITH SHUTDOWN

920 views
Skip to first unread message

Marco Iacolucci

unread,
Jan 6, 2022, 11:43:03 AM1/6/22
to Alt-F
Hello guys,

   I did some package updates in the package section and now when I do a poweroff from the GUI or press for a while the start button the device won't shutdown anymore!

   My device is a DSL320L rev A3 that ran perfectly for years with alt-f but now i cannot power off it.

   I tried to flash again the firmware but nothing changed, please help me!!!

Craig Brigley

unread,
Jan 6, 2022, 6:36:20 PM1/6/22
to Alt-F

Craig Brigley

unread,
Jan 6, 2022, 6:38:06 PM1/6/22
to Alt-F

rafal.p...@gmail.com

unread,
Feb 17, 2022, 7:08:38 AM2/17/22
to Alt-F
Hi,
The same here. Not possible to shutdown or reboot my DNS 320 so I have shutdown.sh with this content provided here:
After the restart initiated by removing and inserting back a powercord now my DNS 320 not even responding for ping :-(
What to do now?

rafal.p...@gmail.com

unread,
Feb 17, 2022, 7:27:39 AM2/17/22
to Alt-F
Second  power off and power on cycle by using a powercord and my DNS 320 is running but Power Off action from within GUI do nothing - device is not switching off.

João Cardoso

unread,
Feb 17, 2022, 3:09:31 PM2/17/22
to Alt-F
On Thursday, February 17, 2022 at 12:08:38 PM UTC rafal.p...@gmail.com wrote:
Hi,
The same here. Not possible to shutdown or reboot my DNS 320 so I have shutdown.sh

The post you quote says:
 "the issue can be solved by using the following in the user boot script (Services->User, user, Configure, "Script to execute on powerup:"" You can edit/create it in the webUI.
It is not a generic script, and it must be on disk, obviously. It has worked for others, so why not for you?

rafal.p...@gmail.com

unread,
Feb 17, 2022, 6:29:41 PM2/17/22
to Alt-F
I don't now why it doesn't work for me. Maybe because no one tested if it works on DNS 320 yet?
And yes, of course, I have it placed on disk where Alt-F is located and it is "editable" via GUI and has execute permission:
 ALT-F DNS 320 startup script.JPG

Jesus M Diaz

unread,
Feb 18, 2022, 2:02:24 AM2/18/22
to al...@googlegroups.com
I am using it and ... sometimes it works and sometimes it doesn't.

My problem is that very often I am getting a 'file doesn't exist' error, and my guess is that because I am using MD devices, sometimes it takes longer for the device to have the disks ready than trying to access the file.

Ideally the system should have some delay to make sure the disks are ready, but it hasn't and I can't add it (or I don't know how to add it).

//JM

--
You received this message because you are subscribed to the Google Groups "Alt-F" group.
To unsubscribe from this group and stop receiving emails from it, send an email to alt-f+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/alt-f/a737898c-08fb-4b5d-8c50-ef47c1063f8en%40googlegroups.com.

rafal.p...@gmail.com

unread,
Feb 18, 2022, 3:04:30 AM2/18/22
to Alt-F
I'm just guessing what could be the reason why it doesn't work for me but maybe it is because Alt-F and startup.sh script are located on "standalone" USB disk which is not a part of volume created with two "inside the box" disks?

Jesus M Diaz

unread,
Feb 18, 2022, 3:51:23 AM2/18/22
to al...@googlegroups.com
I too tried putting the file in an USB disk, and had the same problem: sometimes it works, sometimes the disk is not ready yet ...

I might be wrong, but the only solution I see is João creating a patch adding either a timer to wait X amount of time or checking if the disks are ready, before trying to run the script.

João Cardoso

unread,
Feb 18, 2022, 1:12:36 PM2/18/22
to Alt-F
OK, let's make a resumé: (it should be an executive summary, but I'm too wordy, sorry)

The problem happened on some boxes and someone did it home work and concluded that the issue was due to the 'alt-f-utils' updated pkg; when the update was removed, the problem disappeared. I continued it work and concluded that the culprit was the dns320l-daemon process.
First notice the program name, dns320l-daemon, i.e. it is meant to work on a DNS-320L box. More on that latter.
There is nothing wrong with the program itself, it works fine for me on a DNS-320L or a DNS-327L box, the issue seems to be a conflict between the flash-resident program and the disk-updated program. When I was able to reproduce the problem, I noticed that killing the running dns320l-daemon and waiting for 'init' to relaunch it (more on that latter) the problem went away. So I devised the user boot script to do the same. The user boot script runs when the disk/filesystem where it is stored is discovered. It does not need to be the disk/filesystem where the Alt-F packages are installed, but I advised to store it in the same filesystem. Why?
Some inside trading: the dns320l-daemon is launched by 'init' through /etc/inittab, not as a service. it was done this way so it would be automatically relaunched if any problem with it arises, as it is required to, e.g., power down the box. As this happens earlier in the boot process, even before disks/filesystem are discovered and mounted, the dns320l-daemon is already running from flash when the Alt-F disk/filesystem is discovered and starts being used; then, the updated on-disk dns320l-daemon takes priority over the running one from flash, and the conflicts arises. With normal packages this does not happens, as all on-disk updated pkgs/services are stopped and then started (restarted) though its init scripts.
Now you have mostly all elements to understand the problem: there is a need to stop the flash-running dns320l-daemon. The user boot script does that but in a flawed way, thanks to the "make it fast and cheap" paradigma. It should wait for the Alt-F folder to have been discovered and put in use.
How can that be done? Using the 'aufs.sh -s' command -- it prints OK and returns 0 when the Alt-F folder is in use, so a 'while ! aufs.sh -s; do usleep 100000; done' before the killall stanza I posted before does it. But what if the Alt-F folder does not come up, for whatever reason? Damaged disk, fsck running, USB stick removed... to prevent that, the user init script (/etc/init.d/S99user) is the last one being started and the user boot script is launched by it in the background, so if it never accomplish no big harm happens -- but other issues might come along.

Now, what does the dns-320l-daemon process has to do with power down? D-Link put a new chip in the motherboard of the DNS-320-rev-A, but with limited usage -- it just measures the system temperature, and to read it a special script exists: /usr/sbin/dns320-temp.sh. With the DNS-320-rev-B and later models (DNS-320L, DNS-327L), that chip reads not only the temperature but also controls the fan, leds, powerdow, etc, so the dns320l-daemon is needed. A. Böhlr initially wrote it, see Credits, and I latter continued his work.
So, if you don't have one of those box models you don't have power down problem and you don't need the user boot script for that purpose.
BTW, there isn't differently crafted /etc/inittab for the different boxes, it is /etc/init.d/rcS (that is launched by 'init') that identifies in which box is it being run, comments out /etc/inittab entries, and signals 'init' of the changes.

And what about the readiness of all disks and the Alt-F folder? When I first started Alt-F on the DNS-323, I was constantly swapping and hot plugging disks, it is very easy to do that on that box (and on the DNS-325). So the system never knows how many disks it should have and where they are located -- left bay? right bay? USB SATA adapter? USB disk? No disk at all? and it has to live with it. The same for the Alt-F folder, the user might not have installed any Alt-F package, or a fsck might be running, or whatever. So the system has to work out as it is in the current moment. Android has/had a similar problem with user-inserted or removed SD-cards.

Conclusion:
Experient linux users can use the above, experiment by themselves, report their findings and devise a definitive solution. Un-experimented users have to wait for experienced users findings. That's the status of support currently, don't wait for me to solve issues, help yourself. I'm however ready to clarify, help and advise, as I'm doing now.

I'm still working on and with Alt-F but don't have the time or motivation to answer "HELP me" laconic and information missing requests. This should be top-posted -- ah, no sticky posts exists, I have still to turnaround that Google "group" misfeature!

Jesus M Diaz

unread,
Feb 18, 2022, 4:22:47 PM2/18/22
to al...@googlegroups.com
Hello João,

apologies if I explained myself poorly, and of course thank you for the extensive and clear explanation.

I think I probably introduced some confusion here. The whole 'restart the dns320l-daemon to fix the reboot issue' works perfectly fine, as well as the rest of side effects have been explained multiple times. The problem I personally am finding, and what I understood was the indirect issue someone was having here is the use of the user boot script itself (that I am using for more stuff, and not only to reset the daemon, like adding a secondary IP address).

And here, with the 'user boot script' is where I have not found (yet?) a way for me to fix it, because often, the disk is not ready when the script is called from /usr/sbin/hot_aux.sh and I get the log entries:

hot_aux: Executing "/mnt/sdc1/local.rc start" in background
/usr/sbin/hot_aux.sh: line 314: /mnt/sdc1/local.rc: not found

local.rc is my 'user boot script' and I have tried with both /mnt/sdc1 (USB disk) and /dev/md0 (raid partition), with same result

So, again, apologies if I mixed the reboot issue with the 'user boot script' not found issue. They are not the same, just indirectly related.

Thanks
//JM


jezzaaaa

unread,
Feb 18, 2022, 7:20:20 PM2/18/22
to Alt-F
On Saturday, February 19, 2022 at 5:12:36 AM UTC+11 João Cardoso wrote:
<snip>
How can that be done? Using the 'aufs.sh -s' command -- it prints OK and returns 0 when the Alt-F folder is in use, so a 'while ! aufs.sh -s; do usleep 100000; done' before the killall stanza I posted before does it.

Was this a typo? Here you use "aufs.sh -s" but in the stanza you posted before you instead use "killall -0 dns320l-daemon" . Or are these somehow equivalent?

Cheers
Jeremy

João Cardoso

unread,
Feb 19, 2022, 3:18:58 PM2/19/22
to Alt-F
On Friday, February 18, 2022 at 9:22:47 PM UTC jesusm.d...@gmail.com wrote:
Hello João,

apologies if I explained myself poorly, and of course thank you for the extensive and clear explanation.

That's ok. 

I think I probably introduced some confusion here. The whole 'restart the dns320l-daemon to fix the reboot issue' works perfectly fine, as well as the rest of side effects have been explained multiple times. The problem I personally am finding, and what I understood was the indirect issue someone was having here is the use of the user boot script itself (that I am using for more stuff, and not only to reset the daemon, like adding a secondary IP address).

And here, with the 'user boot script' is where I have not found (yet?) a way for me to fix it, because often, the disk is not ready when the script is called from /usr/sbin/hot_aux.sh and I get the log entries:

hot_aux: Executing "/mnt/sdc1/local.rc start" in background
/usr/sbin/hot_aux.sh: line 314: /mnt/sdc1/local.rc: not found

I think to remember that you reported that on another post. I have examined the code and found nothing wrong. hot_aux.sh  verifies that the file exists and is executable, before executing it...

   if test "/mnt/$lbl" = "$(dirname $USER_SCRIPT)" -a -x "/mnt/$lbl/$(basename $USER_SCRIPT)"; then
    touch $USERLOCK
    logger -st hot_aux "Executing \"$USER_SCRIPT start\" in background"
    $USER_SCRIPT start &
  fi


so the tests are passed and the file executed. I would say that the error is in the script if you hadn't tell that *sometimes* it works. The disk and filesystem are definitively ready at the time the checks are done, the filesystem has even gone though a fsck and mounted.
You can add at the top of the script some diagnostics, such as 'df', to be convinced of that; you can also make the script print its execution  by adding also at the top 'set -x', and you make the script log to a file by adding 'exec', like this:

#!/bin/sh
exec > /var/log/mylog.log 2>&1
set -x
df -h
... rest of the script
 
local.rc is my 'user boot script' and I have tried with both /mnt/sdc1 (USB disk) and /dev/md0 (raid partition), with same result

start testing the default script, without any additions of yours -- rename/save the current file and recreate it using the webUI.
Anyway this is going off topic.

João Cardoso

unread,
Feb 19, 2022, 3:28:17 PM2/19/22
to Alt-F
The aufs.sh line is to be put before the killall lines. It's function is to be wait until the Alt-F dir exists and is functional before killing the existing dns320l-daemon. Then, when init relaunches the dns320l-daemon, the one under the Alt-F dir will be executed instead. Assuming that the alt-f-utils package update has been installed.

while ! aufs.sh -s; do usleep 100000; done
while ! killall -0 dns320l-daemon; do usleep 100000; done
    killall dns320l-daemon


Cheers
Jeremy

Jesus M Diaz

unread,
Feb 19, 2022, 4:51:54 PM2/19/22
to al...@googlegroups.com
Hello João,

On Sat, 19 Feb 2022 at 20:19, João Cardoso <whoami...@gmail.com> wrote:
I think to remember that you reported that on another post. I have examined the code and found nothing wrong. hot_aux.sh  verifies that the file exists and is executable, before executing it...

   if test "/mnt/$lbl" = "$(dirname $USER_SCRIPT)" -a -x "/mnt/$lbl/$(basename $USER_SCRIPT)"; then
    touch $USERLOCK
    logger -st hot_aux "Executing \"$USER_SCRIPT start\" in background"
    $USER_SCRIPT start &
  fi


so the tests are passed and the file executed. I would say that the error is in the script if you hadn't tell that *sometimes* it works. The disk and filesystem are definitively ready at the time the checks are done, the filesystem has even gone though a fsck and mounted.
You can add at the top of the script some diagnostics, such as 'df', to be convinced of that; you can also make the script print its execution  by adding also at the top 'set -x', and you make the script log to a file by adding 'exec', like this:

#!/bin/sh
exec > /var/log/mylog.log 2>&1
set -x
df -h
... rest of the script

As a matter of fact I have some debugs included in the script.

a) I have "exec >> /mnt/sdc1/user.log 2>&1" at the beginning
b) every single possible path in the script has some logging into the same file, for example:

*)
echo "[${TS}] Argument not valid: $0 $@"
;;

And when the script doesn't work ... there is nothing at all in the log, so the script didn't run, simply.

But most importantly, the file /var/log/hot_aux.log is written by /usr/sbin/hot_aux.sh, not by my own script, and it is there where I see the 'file not found error'. This is the current content of hot /var/log/hot_aux.log, where you can see the 'file not found' AFTER apparently mounting both /dev/sdc1 and /dev/md0

[root@cinemateka]8 cat /var/log/hot_aux.log

DATE=Wed Dec 15 13:31:21 GMT 2021
USER=root
ACTION=add
OLDPWD=/dev
HOME=/
MDEV=md0
TERM=vt102
SUBSYSTEM=sdb
PATH=/sbin:/usr/sbin:/bin:/usr/bin
SHELL=/bin/sh
PWD=/dev
DEVTYPE=partition
hot_aux: Start  fscking md0

DATE=Wed Dec 15 13:31:21 GMT 2021
USER=root
HOME=/
OLDPWD=/
MDEV=sdc1
TERM=vt102
SUBSYSTEM=sdc
PATH=/sbin:/usr/sbin:/bin:/usr/bin
SHELL=/bin/sh
PWD=/dev
hot_aux sdc1 waiting to be fscked
hot_aux: Finish fscking md0: fsck 1.41.14 (22-Dec-2010)
/dev/md0: clean, 20616/60989440 files, 65609948/243945278 blocks
hot_aux: Public directory found in md0
hot_aux: Alt-F directory found in md0
hot_aux: Start  fscking sdc1
hot_aux: Finish fscking sdc1: fsck 1.41.14 (22-Dec-2010)
Mounting volume... OK
Processing of $MFT and $MFTMirr completed successfully.
NTFS volume version is 3.1.
NTFS partition /dev/sdc1 was processed successfully.
mv: can't rename '/tmp/check-sdc1.log-': No such file or directory
hot_aux: Backup directory found in sdc1

hot_aux: Executing "/mnt/sdc1/local.rc start" in background
/usr/sbin/hot_aux.sh: line 314: /mnt/sdc1/local.rc: not found
hot_aux: Restarting sslcert:
Stopping sslcert: OK.
Starting sslcert: OK.
hot_aux: Restarting sysctrl:
Stopping sysctrl: OK.
Starting sysctrl: OK.
hot_aux: Restarting smartd:
Stopping smartd: OK.
Starting smartd: OK.
hot_aux: Restarting cacert:
Stopping cacert: OK.
Starting cacert: OK.
hot_aux: Restarting snmpd:
Stopping snmpd: OK.
Starting snmpd: OK.
hot_aux: Restarting minidlna:
Stopping minidlna: OK.
Starting minidlna: OK.
hot_aux:  Starting rtorrent...              done.
Starting lighttpd...              done.
Starting syslog-ng...              done.
hot_aux: Restarting syncthing:
Stopping syncthing: OK.
Starting syncthing: OK.
hot_aux: Restarting minidlna:
Stopping minidlna: OK.
Starting minidlna: OK.
[root@cinemateka]9

Thanks again

João Cardoso

unread,
Feb 20, 2022, 12:09:29 PM2/20/22
to Alt-F
On Saturday, February 19, 2022 at 9:51:54 PM UTC jesusm.d...@gmail.com wrote:
Hello João,

On Sat, 19 Feb 2022 at 20:19, João Cardoso <whoami...@gmail.com> wrote:
I think to remember that you reported that on another post. I have examined the code and found nothing wrong. hot_aux.sh  verifies that the file exists and is executable, before executing it...

   if test "/mnt/$lbl" = "$(dirname $USER_SCRIPT)" -a -x "/mnt/$lbl/$(basename $USER_SCRIPT)"; then
    touch $USERLOCK
    logger -st hot_aux "Executing \"$USER_SCRIPT start\" in background"
    $USER_SCRIPT start &
  fi


so the tests are passed and the file executed. I would say that the error is in the script if you hadn't tell that *sometimes* it works. The disk and filesystem are definitively ready at the time the checks are done, the filesystem has even gone though a fsck and mounted.
You can add at the top of the script some diagnostics, such as 'df', to be convinced of that; you can also make the script print its execution  by adding also at the top 'set -x', and you make the script log to a file by adding 'exec', like this:

#!/bin/sh
exec > /var/log/mylog.log 2>&1
set -x
df -h
... rest of the script

As a matter of fact I have some debugs included in the script.

a) I have "exec >> /mnt/sdc1/user.log 2>&1" at the beginning
b) every single possible path in the script has some logging into the same file, for example:

*)
echo "[${TS}] Argument not valid: $0 $@"
;;

And when the script doesn't work ... there is nothing at all in the log, so the script didn't run, simply.

But most importantly, the file /var/log/hot_aux.log is written by /usr/sbin/hot_aux.sh, not by my own script, and it is there where I see the 'file not found error'. This is the current content of hot /var/log/hot_aux.log, where you can see the 'file not found' AFTER apparently

Apparently? You can verify, using the command line, if the fs is mounted and the file exists after the boot. You can even see if you can execute it
"Volume"? S-) 
 
Processing of $MFT and $MFTMirr completed successfully.
NTFS volume version is 3.1.

Ahhh, NTFS! That must be the problem. But you said the problem also exists when the script is saved in /mnt/md0/... confused.
Anyway, I know that NTFS file permissions are different from unix, and the intervening ntfs-3g who makes the mount and accesses (and the ntfs-3g-progs that does the fsck) have to translate them to unix permissions. It might even happens that it needs some time to settle down.
I have never tried to execute files in linux alien fs, like FAT or NTFS. You have to do that by yourself: After a failed execution of your boot script, see if the file exists and is executable, and execute it, something like

. /etc/misc.conf
if test -x "$USER_SCRIPT"; then $USER_SCRIPT; fi

if it works, then it might be a timing issue with ntfs-3g, perhaps adding a small delay at hot_aux.sh after the mount solves it?
You can power down the box and unplug the NTFS USB, then power up. After power up, you can edit /usr/sbin/hot_aux.sh and add a 'sleep 3' near the end, but before the launching of the user script. You can then plug in the USB and watch the hot_aux.log. The edited hot_aux.sh will stay in memory, override the original one, and used in new invocations; if the Alt-F folder is available, the changes will be kept in disk, and the edited file will be used after the Alt-F folder is discovered and put in use ('aufs.sh -s' tells you that).

NTFS partition /dev/sdc1 was processed successfully.
mv: can't rename '/tmp/check-sdc1.log-': No such file or directory
hot_aux: Backup directory found in sdc1

hot_aux: Executing "/mnt/sdc1/local.rc start" in background
/usr/sbin/hot_aux.sh: line 314: /mnt/sdc1/local.rc: not found
hot_aux: Restarting sslcert:
Stopping sslcert: OK.
Starting sslcert: OK.
hot_aux: Restarting sysctrl:
Stopping sysctrl: OK.
Starting sysctrl: OK.
hot_aux: Restarting smartd:
Stopping smartd: OK.
Starting smartd: OK.
hot_aux: Restarting cacert:
Stopping cacert: OK.
Starting cacert: OK.
hot_aux: Restarting snmpd:
Stopping snmpd: OK.
Starting snmpd: OK.
hot_aux: Restarting minidlna:
Stopping minidlna: OK.
Starting minidlna: OK.
hot_aux:  Starting rtorrent...              done.

Where did you get rtorrent from? Entware? Installed in the NTFS fs? No issues?

Jesus M Diaz

unread,
Feb 20, 2022, 4:31:04 PM2/20/22
to al...@googlegroups.com
Will try to answer/comment all the open points:

1. I said 'apparently' actually meaning it was mounted, and when the script fails after a boot of the box, I can run it manually without a problem, it is indeed what I do to get everything up and running, so it is clear that the disks are indeed minted. My emphasys here was in the *after* part, because I do not understand why after mounting the disk, the file is not found.

2. NTFS is indeed the USB disk, but the RAID is using ext4 and the problems show the same:

/dev/md0 on /mnt/md0 type ext4 (rw,relatime,data=ordered)
/dev/sdc1 on /mnt/sdc1 type fuseblk (rw,relatime,user_id=0,group_id=0,allow_other,blksize=4096)

3. As said, running the script manually from the NTFS disk works fine.

4. rTorrent came from entware, but I am not using it any longer, but I removed it after the last box reboot on 15th December

Now ... I will put the script again in /dev/md0 (ext4) and will try to reboot the box and see what happens ...

Thanks for the time you are dedicating to look into this.

//JM

--
You received this message because you are subscribed to the Google Groups "Alt-F" group.
To unsubscribe from this group and stop receiving emails from it, send an email to alt-f+un...@googlegroups.com.

Joao Cardoso

unread,
Feb 20, 2022, 9:22:55 PM2/20/22
to Alt-F
On Sunday, February 20, 2022 at 9:31:04 PM UTC jesusm.d...@gmail.com wrote:
Will try to answer/comment all the open points:

1. I said 'apparently' actually meaning it was mounted, and when the script fails after a boot of the box, I can run it manually without a problem, it is indeed what I do to get everything up and running, so it is clear that the disks are indeed minted. My emphasys here was in the *after* part, because I do not understand why after mounting the disk, the file is not found.

2. NTFS is indeed the USB disk, but the RAID is using ext4 and the problems show the same:

/dev/md0 on /mnt/md0 type ext4 (rw,relatime,data=ordered)
/dev/sdc1 on /mnt/sdc1 type fuseblk (rw,relatime,user_id=0,group_id=0,allow_other,blksize=4096)

3. As said, running the script manually from the NTFS disk works fine.

4. rTorrent came from entware, but I am not using it any longer, but I removed it after the last box reboot on 15th December

Now ... I will put the script again in /dev/md0 (ext4) and will try to reboot the box and see what happens ...

First please post the output of the command

echo -n ":"; head -1 /mnt/sdc1/local.rc
 
If the culprit is not NTFS, the command output might yell to you ;-(

Jesus M Diaz

unread,
Feb 21, 2022, 3:13:14 AM2/21/22
to al...@googlegroups.com
hi!

Some more tests, and odd results.

I am rebooting the box and executing these commands to check the status:

cat /etc/misc.conf
echo -n ":"; head -1 /mnt/sdc1/local.rc
echo -n ":"; head -1 /mnt/md0/local.rc
cat /var/log/hot_aux.log
ifconfig 
(quick way to double-check if the user script was run)
/mnt/md0/local.rc start
cat /mnt/sdc1/user.log


Scenario 1: user script configured to /mnt/md0/local.rc

jesusm@cinemateka's password:
[jesusm@cinemateka ~]$ exec su -
Password:
COLUMNS=131;LINES=40;export COLUMNS LINES;
[root@cinemateka]1 cat /etc/misc.conf
HDSLEEP_LEFT=20
HDSLEEP_RIGHT=20
HDSLEEP_USB=20
FIXSITE=http://sourceforge.net/projects/alt-f/files/fixes
FFPSITE=http://www.inreto.de/dns323/fun-plug
NEWS_CHK=1579976961
NTPD_DAEMON=yes
NTPD_BOOT=yes
CLEAN_STALE_NFS=y
MDADM_EMAIL_TEST=--test
MDADM_INTERVAL=30
MAILTO="jesusm.d...@gmail.com"
FILES_CHK=1630246913
"SL_CERT_BITS="4096
USER_SCRIPT="/mnt/md0/local.rc" 
<<<< apparently ok
USER_LOGFILE="yes"
[root@cinemateka]2 echo -n ":"; head -1 /mnt/sdc1/local.rc
:#!/usr/bin/bash
[root@cinemateka]3 echo -n ":"; head -1 /mnt/md0/local.rc
:#!/usr/bin/bash
[root@cinemateka]4
[root@cinemateka]4 cat /var/log/hot_aux.log 
<<<< weird, no mention to the user script at all in the log ???

DATE=Mon Feb 21 07:45:02 GMT 2022

USER=root
ACTION=add
OLDPWD=/dev
HOME=/
MDEV=md0
TERM=vt102
SUBSYSTEM=sdb
PATH=/sbin:/usr/sbin:/bin:/usr/bin
SHELL=/bin/sh
PWD=/dev
DEVTYPE=partition
hot_aux: Start  fscking md0

DATE=Mon Feb 21 07:45:02 GMT 2022

USER=root
HOME=/
OLDPWD=/
MDEV=sdc1
TERM=vt102
SUBSYSTEM=sdc
PATH=/sbin:/usr/sbin:/bin:/usr/bin
SHELL=/bin/sh
PWD=/dev
hot_aux sdc1 waiting to be fscked
hot_aux: Finish fscking md0: fsck 1.41.14 (22-Dec-2010)
/dev/md0: clean, 15916/60989440 files, 80839072/243945278 blocks

hot_aux: Public directory found in md0
hot_aux: Alt-F directory found in md0
hot_aux: Start  fscking sdc1
hot_aux: Finish fscking sdc1: fsck 1.41.14 (22-Dec-2010)
Mounting volume... OK
Processing of $MFT and $MFTMirr completed successfully.
NTFS volume version is 3.1.
NTFS partition /dev/sdc1 was processed successfully.
hot_aux: Backup directory found in sdc1
hot_aux: Restarting sslcert:
Stopping sslcert: OK.
Starting sslcert: OK.
hot_aux: Restarting sysctrl:
Stopping sysctrl: OK.
Starting sysctrl: OK.
hot_aux: Restarting smartd:
Stopping smartd: OK.
Starting smartd: OK.
hot_aux: Restarting cacert:
Stopping cacert: OK.
Starting cacert: OK.
hot_aux: Restarting lighttpd:
Stopping lighttpd: OK.
Starting lighttpd: OK.

hot_aux: Restarting snmpd:
Stopping snmpd: OK.
Starting snmpd: OK.
hot_aux: Restarting minidlna:
Stopping minidlna: OK.
Starting minidlna: OK.
hot_aux:  Starting syslog-ng...              done.
hot_aux: Restarting syncthing:
Stopping syncthing: OK.
Starting syncthing: OK.
hot_aux: Restarting transmission-daemon:
Stopping transmission-daemon: OK.
Starting transmission-daemon: OK.

hot_aux: Restarting minidlna:
Stopping minidlna: OK.
Starting minidlna: OK.
hot_aux: Restarting transmission-daemon:
Stopping transmission-daemon: OK.
Starting transmission-daemon: OK.
[root@cinemateka]5 ifconfig 
<<<< only primary IP address, ergo no user script ran
eth0      Link encap:Ethernet  HWaddr 6C:72:20:05:96:6E  
inet addr:192.168.0.2  Bcast:192.168.0.255  Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
RX packets:4773 errors:0 dropped:42 overruns:0 frame:0
TX packets:6079 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:821988 (802.7 KiB)  TX bytes:661290 (645.7 KiB)
Interrupt:86

lo        Link encap:Local Loopback  
inet addr:127.0.0.1  Mask:255.0.0.0
UP LOOPBACK RUNNING  MTU:65536  Metric:1
RX packets:276 errors:0 dropped:0 overruns:0 frame:0
TX packets:276 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1
RX bytes:22987 (22.4 KiB)  TX bytes:22987 (22.4 KiB)

[root@cinemateka]6 /mnt/md0/local.rc start 
<<<< run manually the user script, everything ok
[root@cinemateka]7 cat /mnt/sdc1/user.log
[20220221-074417] Stopping /mnt/md0/local.rc
[20220221-074656] Starting /mnt/md0/local.rc
++ Refreshing dns320l-daemon ...
++ Enabling Power recovery
OK
++ Enabling IP Forwarding
net.ipv4.ip_forward = 1
++ adding secondary ip addresses
.. iot: 192.168.253.254/255.255.255.0
.. mmd: 192.168.254.254/255.255.255.0
.. unkown: 192.168.255.254/255.255.255.0
++ restarting dnsmasq after 10 seconds ... just in case
Restarting dnsmasq:
Stopping dnsmasq: OK.
Starting dnsmasq: OK.
[root@cinemateka]8

Probably some dumb mistake on my side, apparently the box is not aware of the user script when saved (and configured) in /mnt/md0

Scenario 2: user script configured to /mnt/sdc1/local.rc

jesusm@cinemateka's password:  
Permission denied, please try again. 
<<<< yup, I typed wrong the pass, but wanted to copy the output as is :-) 
jesusm@cinemateka's password:  
[jesusm@cinemateka ~]$ exec su -
Password:  
COLUMNS=131;LINES=40;export COLUMNS LINES;
[root@cinemateka]1 cat /etc/misc.conf  
HDSLEEP_LEFT=20
HDSLEEP_RIGHT=20
HDSLEEP_USB=20
FIXSITE=http://sourceforge.net/projects/alt-f/files/fixes
FFPSITE=http://www.inreto.de/dns323/fun-plug
NEWS_CHK=1579976961
NTPD_DAEMON=yes
NTPD_BOOT=yes
CLEAN_STALE_NFS=y
MDADM_EMAIL_TEST=--test
MDADM_INTERVAL=30
MAILTO="jesusm.d...@gmail.com"
FILES_CHK=1630246913
"SL_CERT_BITS="4096
USER_SCRIPT="/mnt/sdc1/local.rc" 
<<<< apparently ok
USER_LOGFILE="yes"
[root@cinemateka]2 echo -n ":"; head -1 /mnt/sdc1/local.rc
:#!/usr/bin/bash
[root@cinemateka]3 echo -n ":"; head -1 /mnt/md0/local.rc
:#!/usr/bin/bash
[root@cinemateka]4 cat /var/log/hot_aux.log

DATE=Mon Feb 21 07:53:15 GMT 2022
USER=root
ACTION=add
OLDPWD=/dev
HOME=/
MDEV=md0
TERM=vt102
SUBSYSTEM=sdb
PATH=/sbin:/usr/sbin:/bin:/usr/bin
SHELL=/bin/sh
PWD=/dev
DEVTYPE=partition
hot_aux: Start  fscking md0

DATE=Mon Feb 21 07:53:15 GMT 2022
USER=root
HOME=/
OLDPWD=/
MDEV=sdc1
TERM=vt102
SUBSYSTEM=sdc
PATH=/sbin:/usr/sbin:/bin:/usr/bin
SHELL=/bin/sh
PWD=/dev
hot_aux sdc1 waiting to be fscked
hot_aux: Finish fscking md0: fsck 1.41.14 (22-Dec-2010)
/dev/md0: clean, 15909/60989440 files, 80838887/243945278 blocks
hot_aux: Public directory found in md0
hot_aux: Alt-F directory found in md0
hot_aux: Start  fscking sdc1
hot_aux: Finish fscking sdc1: fsck 1.41.14 (22-Dec-2010)
Mounting volume... OK
Processing of $MFT and $MFTMirr completed successfully.
NTFS volume version is 3.1.
NTFS partition /dev/sdc1 was processed successfully. <<<< partition mounted ...

hot_aux: Backup directory found in sdc1
hot_aux: Executing "/mnt/sdc1/local.rc start" in background <<<< file found and is executable, per the standard pre-check
/usr/sbin/hot_aux.sh: line 314: /mnt/sdc1/local.rc: not found 
<<<< not found ???

hot_aux: Restarting sslcert:  
Stopping sslcert: OK.
Starting sslcert: OK.
hot_aux: Restarting sysctrl:  
Stopping sysctrl: OK.
Starting sysctrl: OK.
hot_aux: Restarting smartd:  
Stopping smartd: OK.
Starting smartd: OK.
hot_aux: Restarting cacert:  
Stopping cacert: OK.
Starting cacert: OK.
hot_aux: Restarting lighttpd:  
Stopping lighttpd: OK.
Starting lighttpd: OK.
hot_aux: Restarting snmpd:  
Stopping snmpd: OK.
Starting snmpd: OK.
hot_aux: Restarting minidlna:  
Stopping minidlna: OK.
Starting minidlna: OK.
hot_aux:  Starting syslog-ng...              done.  

hot_aux: Restarting syncthing:  
Stopping syncthing: OK.
Starting syncthing: OK.
hot_aux: Restarting transmission-daemon:  
Stopping transmission-daemon: OK.
Starting transmission-daemon: OK.
hot_aux: Restarting minidlna:  
Stopping minidlna: OK.
Starting minidlna: OK.
hot_aux: Restarting transmission-daemon:  
Stopping transmission-daemon: OK.
Starting transmission-daemon: OK.
[root@cinemateka]5 ifconfig
eth0      Link encap:Ethernet  HWaddr 6C:72:20:05:96:6E   
inet addr:192.168.0.2  Bcast:192.168.0.255  Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
RX packets:6157 errors:0 dropped:57 overruns:0 frame:0
TX packets:7935 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000  
RX bytes:1013934 (990.1 KiB)  TX bytes:925510 (903.8 KiB)
Interrupt:86  

lo        Link encap:Local Loopback   
inet addr:127.0.0.1  Mask:255.0.0.0
UP LOOPBACK RUNNING  MTU:65536  Metric:1
RX packets:456 errors:0 dropped:0 overruns:0 frame:0
TX packets:456 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1  
RX bytes:37802 (36.9 KiB)  TX bytes:37802 (36.9 KiB)

[root@cinemateka]6 /mnt/sdc1/local.rc start
[root@cinemateka]7 cat /mnt/sdc1/user.log
[20220221-074921] Stopping /mnt/sdc1/local.rc
[20220221-075114] Starting /mnt/md0/local.rc
++ Refreshing dns320l-daemon ...
++ Enabling Power recovery
OK
++ Enabling IP Forwarding
net.ipv4.ip_forward = 1
++ adding secondary ip addresses
.. iot: 192.168.253.254/255.255.255.0
.. mmd: 192.168.254.254/255.255.255.0
.. unkown: 192.168.255.254/255.255.255.0
++ restarting dnsmasq after 10 seconds ... just in case
Restarting dnsmasq:
Stopping dnsmasq: OK.
Starting dnsmasq: OK.
[20220221-075231] Stopping /mnt/sdc1/local.rc
[20220221-075513] Starting /mnt/sdc1/local.rc
++ Refreshing dns320l-daemon ...
++ Enabling Power recovery
OK
++ Enabling IP Forwarding
net.ipv4.ip_forward = 1
++ adding secondary ip addresses
.. iot: 192.168.253.254/255.255.255.0
.. mmd: 192.168.254.254/255.255.255.0
.. unkown: 192.168.255.254/255.255.255.0
++ restarting dnsmasq after 10 seconds ... just in case
Restarting dnsmasq:
Stopping dnsmasq: OK.
Starting dnsmasq: OK.
[root@cinemateka]8

So ... I have no clue where the problem may be. ANd I'd really wish it was a dumb mistake on my side, but so far, I didn't find it.

Thanks

//JM

João Cardoso

unread,
Feb 21, 2022, 12:57:42 PM2/21/22
to Alt-F
This is illegal syntax, it should be
SSL_CERT_BITS="4096"
 
USER_SCRIPT="/mnt/md0/local.rc" <<<< apparently ok
USER_LOGFILE="yes"
[root@cinemateka]2 echo -n ":"; head -1 /mnt/sdc1/local.rc
:#!/usr/bin/bash
[root@cinemateka]3 echo -n ":"; head -1 /mnt/md0/local.rc
:#!/usr/bin/bash

As I suspected. It *has* to be /bin/sh, /usr/bin/bash is from an on-disk installable package, and the Alt-F folder might not be available at the time the user script is invoked.

Notice the comment in hot_aux.sh:
  # the user script might need the Alt-F dir aufs mounted, so run it last
That's why I recommend to save the user script in the same filesystem as the Alt-F folder is. But it is not a warranty, it's a mitigation.

When you run the user script from the command line, then bash is already available and the script runs fine. The script itself can wait for Alt-F to be setup (using 'aufs.sh -s') if it needs to use some command available from a package,  but when the script is invoked it's interpreter (the '#!<interpreter>' in the script first line/column) must be available.

Thus, in the hot_aux.log message "/usr/sbin/hot_aux.sh: line 314: /mnt/sdc1/local.rc: not found " the "not found" refers to the script interpreter *you* specified, /usr/bin/bash, not to the script file. The default is to use '#!/bin/sh', that's why I asked you some posts ago to try a webUI fresh created script file.
 
That's it. Not reading anything bellow.

Jesus M Diaz

unread,
Feb 21, 2022, 5:00:40 PM2/21/22
to al...@googlegroups.com
And indeed that was.

I really appreciate the time you dedicated to this and the explanations you provided. It wasn't entirely clear to me before as the 'disk' was already there, but you are right, the 'disk' was, the Alt-F folder maybe not.

Thanks!

//JM


Claudio

unread,
Apr 5, 2022, 9:07:53 AM4/5/22
to Alt-F
Hello, is this problem been solved?
I'm having the same issue and I have to manually launch:
"killal dns320l-daemon" 
before the shutdown button returns to work

Jesus M Diaz

unread,
Apr 5, 2022, 9:15:00 AM4/5/22
to al...@googlegroups.com
Yes, the failure of the boot script was actually some misunderstanding on my side, I was using 'bash' as the interpreter but is is not available after the end of the boot process, so changed it to 'sh' solved the problem.

//JM

Joao Cardoso

unread,
Apr 5, 2022, 7:13:53 PM4/5/22
to Alt-F
On Tuesday, April 5, 2022 at 2:07:53 PM UTC+1 Claudio wrote:
Hello, is this problem been solved?
I'm having the same issue and I have to manually launch:
"killal dns320l-daemon" 
before the shutdown button returns to work

Reply all
Reply to author
Forward
0 new messages