User --> entware not starting

179 views
Skip to first unread message

Ram Set

unread,
Mar 5, 2018, 3:41:48 PM3/5/18
to Alt-F
Hello. 

I have a package installed from entware and it shows up under user. 

The problem is that it does not start at reboot even though is enabled to do that. 

If i manually press on StartNow, it starts without any issues.

Everything is configured properly.

I'm not sure what logs to check to see if entware is facing an error at boot.

I can manually start the app via the userscript but that's not something i'm fond of doing.

Where can I see if entware fails to start at boot.

I have the S81entware file in /etc/init.d/ and it has the following content:

#!/bin/sh

DESC="software repository for network attached storages, routers and other embedded devices."
TYPE=user

. /etc/init.d/common

if ! test -f /opt/etc/init.d/rc.unslung; then
echo "No Entware-ng installation found."
exit 1
fi

export PATH=/opt/bin:/opt/sbin:$PATH

case "$1" in
start) /opt/etc/init.d/rc.unslung start ;;
stop) /opt/etc/init.d/rc.unslung stop ;;
status) /opt/etc/init.d/rc.unslung check ;;
restart) /opt/etc/init.d/rc.unslung restart ;;
*)  usage $0 "start|stop|status|restart" ;;
esac


and in /opt/etc/init.d/ i have the start file for the program defined. Executable with the following content:


#!/bin/sh

ENABLED=yes
PROCS=apcupsd
ARGS=""
PREARGS=""
DESC=$PROCS
PATH=/opt/sbin:/opt/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin

. /opt/etc/init.d/rc.func

João Cardoso

unread,
Mar 6, 2018, 11:41:44 AM3/6/18
to Alt-F


On Monday, 5 March 2018 20:41:48 UTC, Ram Set wrote:
Hello. 

I have a package installed from entware and it shows up under user. 

The problem is that it does not start at reboot even though is enabled to do that. 

I can't reproduce that.
You can use System Utilities->View Logs, System Log (the 'logread' command) to see logs. After a reboot, I can see at the bottom (I don't have a UPS)

Mar  6 16:33:53 DNS-320L user.notice root: Started apcupsd from .
Mar  6 16:33:53 DNS-320L user.notice hot_aux: ^[[1;37m Starting apcupsd... ^[[m            ^[[1;32m done. ^[[m
Mar  6 16:33:53 DNS-320L daemon.notice apcupsd[1444]: apcupsd 3.14.14 (31 May 2016) unknown startup succeeded
Mar  6 16:33:55 DNS-320L daemon.info apcupsd[1444]: NIS server startup succeeded
Mar  6 16:34:06 DNS-320L daemon.err apcupsd[1444]: apcupsd FATAL ERROR in smartsetup.c at line 155 PANIC! Cannot communicate with UPS via serial port. Please make sure the port specified on the DEVICE directive is correct, and that your cable specification on the UPSCABL
Mar  6 16:34:06 DNS-320L daemon.err apcupsd[1444]: apcupsd error shutdown completed

  
You also examine entware logs at /opt/var/log, e.g. 'apcupsd.events':

Ram Set

unread,
Mar 8, 2018, 1:41:45 PM3/8/18
to Alt-F

[root@MezelNAS2]# logread
Mar  8 11:34:50 MezelNAS2 syslog.info syslogd started: BusyBox v1.20.2
Mar  8 11:34:50 MezelNAS2 user.notice kernel: klogd started: BusyBox v1.20.2 (2017-06-14 15:38:45 WEST)
Mar  8 11:34:50 MezelNAS2 user.notice hot_aux: Restarting syslogd:  Stopping klogd: OK. Stopping syslogd: OK. Starting syslogd: OK. Starting klogd: OK.
Mar  8 11:34:53 MezelNAS2 user.notice hot_aux: Restarting urandom:  Stopping urandom: OK. Starting urandom: OK.
Mar  8 11:34:54 MezelNAS2 user.notice hot_aux: Restarting sslcert:  Stopping sslcert: OK. Starting sslcert: OK.
Mar  8 11:34:54 MezelNAS2 user.notice hot_aux: Stopping modload: OK. Starting modload: OK.
Mar  8 11:34:55 MezelNAS2 user.notice hot_aux: Restarting sysctrl:  Stopping sysctrl: OK. Starting sysctrl: OK.
Mar  8 11:34:55 MezelNAS2 daemon.info sysctrl: Starting
Mar  8 11:34:55 MezelNAS2 daemon.info sysctrl: reading /etc/bay
Mar  8 11:34:55 MezelNAS2 daemon.info sysctrl: reading /etc/misc.conf
Mar  8 11:34:55 MezelNAS2 daemon.info sysctrl: reading /etc/sysctrl.conf
Mar  8 11:34:55 MezelNAS2 daemon.info sysctrl: args.lo_fan=2000
Mar  8 11:34:55 MezelNAS2 daemon.info sysctrl: args.hi_fan=5500
Mar  8 11:34:55 MezelNAS2 daemon.info sysctrl: args.lo_temp=40
Mar  8 11:34:55 MezelNAS2 daemon.info sysctrl: args.hi_temp=50
Mar  8 11:34:55 MezelNAS2 daemon.info sysctrl: args.hist_temp=1.0
Mar  8 11:34:55 MezelNAS2 daemon.info sysctrl: args.disks_temp=1
Mar  8 11:34:55 MezelNAS2 daemon.info sysctrl: args.fan_mode=AUTO
Mar  8 11:34:55 MezelNAS2 daemon.info sysctrl: args.mail=1
Mar  8 11:34:55 MezelNAS2 daemon.info sysctrl: args.recovery=1
Mar  8 11:34:55 MezelNAS2 daemon.info sysctrl: args.fan_off_temp=38
Mar  8 11:34:55 MezelNAS2 daemon.info sysctrl: args.max_fan_speed=6000
Mar  8 11:34:55 MezelNAS2 daemon.info sysctrl: args.crit_temp=52
Mar  8 11:34:55 MezelNAS2 daemon.info sysctrl: args.warn_temp=49
Mar  8 11:34:55 MezelNAS2 daemon.info sysctrl: args.crit_temp_command="/etc/ct.sh"
Mar  8 11:34:55 MezelNAS2 daemon.info sysctrl: args.warn_temp_command="/etc/wt.sh"
Mar  8 11:34:55 MezelNAS2 daemon.info sysctrl: args.front_button_command1="(null)"
Mar  8 11:34:55 MezelNAS2 daemon.info sysctrl: args.front_button_command2="(null)"
Mar  8 11:34:55 MezelNAS2 daemon.info sysctrl: args.back_button_command="(null)"
Mar  8 11:34:55 MezelNAS2 daemon.info sysctrl: ndisks=2
Mar  8 11:34:55 MezelNAS2 daemon.info sysctrl: sdb left rdwr=0 last=0 spindow=1200 power=1
Mar  8 11:34:55 MezelNAS2 daemon.info sysctrl: sda right rdwr=0 last=0 spindow=1200 power=1
Mar  8 11:34:55 MezelNAS2 daemon.info sysctrl: (null) (null) rdwr=0 last=0 spindow=1200 power=1
Mar  8 11:34:55 MezelNAS2 daemon.info smartd[906]: smartd received signal 15: Terminated
Mar  8 11:34:55 MezelNAS2 daemon.info smartd[906]: smartd is exiting (exit status 0)
Mar  8 11:34:56 MezelNAS2 daemon.info smartd[1494]: smartd 6.5 2016-05-07 r4318 [armv5tel-linux-4.4.45] (local build)
Mar  8 11:34:56 MezelNAS2 daemon.info smartd[1494]: Copyright (C) 2002-16, Bruce Allen, Christian Franke, www.smartmontools.org
Mar  8 11:34:56 MezelNAS2 daemon.info smartd[1494]: Opened configuration file /etc/smartd.conf
Mar  8 11:34:56 MezelNAS2 daemon.info smartd[1494]: Configuration file /etc/smartd.conf was parsed, found DEVICESCAN, scanning devices
Mar  8 11:34:56 MezelNAS2 daemon.info smartd[1494]: Device: /dev/sda, type changed from 'scsi' to 'sat'
Mar  8 11:34:56 MezelNAS2 daemon.info smartd[1494]: Device: /dev/sda [SAT], opened
Mar  8 11:34:56 MezelNAS2 daemon.info smartd[1494]: Device: /dev/sda [SAT], Hitachi HUA723030ALA640, S/N:MK0351YHH5MJNA, WWN:5-000cca-225d0a6b3, FW:MKAOAA50, 3.00 TB
Mar  8 11:34:57 MezelNAS2 daemon.info smartd[1494]: Device: /dev/sda [SAT], found in smartd database: Hitachi Ultrastar 7K3000
Mar  8 11:34:57 MezelNAS2 daemon.info smartd[1494]: Device: /dev/sda [SAT], enabled SMART Attribute Autosave.
Mar  8 11:34:58 MezelNAS2 daemon.info smartd[1494]: Device: /dev/sda [SAT], enabled SMART Automatic Offline Testing.
Mar  8 11:34:58 MezelNAS2 daemon.info smartd[1494]: Device: /dev/sda [SAT], is SMART capable. Adding to "monitor" list.
Mar  8 11:34:58 MezelNAS2 daemon.info smartd[1494]: Device: /dev/sdb, type changed from 'scsi' to 'sat'
Mar  8 11:34:58 MezelNAS2 daemon.info smartd[1494]: Device: /dev/sdb [SAT], opened
Mar  8 11:34:58 MezelNAS2 daemon.info smartd[1494]: Device: /dev/sdb [SAT], Hitachi HUA723030ALA640, S/N:MK0361YHGRAZ2D, WWN:5-000cca-225ca2958, FW:MKAOAA50, 3.00 TB
Mar  8 11:34:58 MezelNAS2 daemon.info smartd[1494]: Device: /dev/sdb [SAT], found in smartd database: Hitachi Ultrastar 7K3000
Mar  8 11:34:59 MezelNAS2 user.notice udhcpc: Renew: Using 192.168.1.7 for 3600 seconds
Mar  8 11:34:59 MezelNAS2 user.notice udhcpc: Updating /etc/hosts: 192.168.1.7 MezelNAS2.local MezelNAS2
Mar  8 11:34:59 MezelNAS2 user.notice udhcpc: Updating /etc/httpd.conf: allow 192.168.1.0/255.255.255.0
Mar  8 11:34:59 MezelNAS2 daemon.info smartd[1494]: Device: /dev/sdb [SAT], enabled SMART Attribute Autosave.
Mar  8 11:34:59 MezelNAS2 user.notice udhcpc: Updating /etc/samba/smb.conf: allow 192.168.1.0/255.255.255.0
Mar  8 11:34:59 MezelNAS2 user.notice udhcpc: Updating eth0 default route: adding route 192.168.1.1
Mar  8 11:34:59 MezelNAS2 user.notice udhcpc: Updating /etc/resolv.conf: adding nameserver 192.168.1.3 192.168.1.5
Mar  8 11:34:59 MezelNAS2 daemon.info smartd[1494]: Device: /dev/sdb [SAT], enabled SMART Automatic Offline Testing.
Mar  8 11:35:00 MezelNAS2 daemon.info smartd[1494]: Device: /dev/sdb [SAT], is SMART capable. Adding to "monitor" list.
Mar  8 11:35:00 MezelNAS2 daemon.info smartd[1494]: Monitoring 2 ATA/SATA, 0 SCSI/SAS and 0 NVMe devices
Mar  8 11:35:01 MezelNAS2 cron.err crond[918]: user root: parse error at 15
Mar  8 11:35:01 MezelNAS2 cron.info crond[918]: crond: USER root pid 1601 cmd /mnt/sda2/sshNot.sh >/dev/null 2>&1
Mar  8 11:35:01 MezelNAS2 user.notice hot_aux: Restarting smartd:  Stopping smartd: OK. Starting smartd: OK.
Mar  8 11:35:01 MezelNAS2 daemon.info smartd[1610]: smartd has fork()ed into background mode. New PID=1610.
Mar  8 11:35:02 MezelNAS2 user.notice hot_aux: Restarting backup:  Stopping backup: OK. Starting backup: OK.
Mar  8 11:35:03 MezelNAS2 user.notice hot_aux: Restarting news:  Stopping news: OK. Starting news: OK.
Mar  8 11:35:11 MezelNAS2 cron.err crond[918]: user root: parse error at 1,
Mar  8 11:35:11 MezelNAS2 cron.err crond[918]: user root: parse error at 15
Mar  8 11:36:01 MezelNAS2 cron.err crond[918]: user root: parse error at 1,
Mar  8 11:36:01 MezelNAS2 cron.err crond[918]: user root: parse error at 15


 apcupsd.events has no entry (i cleaned before reboot)

Bill Rosenberg

unread,
Mar 8, 2018, 5:21:12 PM3/8/18
to Alt-F
You might check this thread to see if it applies.


Ram Set

unread,
Mar 9, 2018, 12:13:51 PM3/9/18
to Alt-F
I have re-installed entware from scratch. 

I already had init.d present and I see the script present for entware in there, persistent after the reboot however entware is not starting.

João Cardoso

unread,
Mar 9, 2018, 1:50:33 PM3/9/18
to Alt-F


On Friday, 9 March 2018 17:13:51 UTC, Ram Set wrote:
I have re-installed entware from scratch. 

I already had init.d present and I see the script present for entware in there, persistent after the reboot however entware is not starting.


Bill's post addresses a real bug regarding the Alt-F Entware install script.
Either the solution it points to, or installing an Alt-F package that creates /Alt-F/etc/init.d/ before the Entware-ng install  solves it (such a simple pkg can be 'polipo', it can be removed afterwards)

Regarding your issue: 
The only action that the S81entware scripts takes is to call Entware own init script, rc.unslung, which is responsible for starting or stopping its own (set executable) services -- beware that most Entware init scripts don't return its correct status.

So, please post the output of the following commands:

ls -l /Alt-F/etc/init.d/
ls
-l /Alt-F/opt/etc/init.d/
cat
/tmp/board /etc/Alt-F # we don't know

I would expect:
[root@DNS-320L]# ls -l /Alt-F/opt/etc/init.d/
-rwxr-xr-x    1 root     root           180 Jan  4 08:53 S17apcupsd
-rw-r--r--    1 root     root          2822 Jan  4 08:53 rc.func
-rwxr-xr-x    1 root     root           927 Jan  4 08:53 rc.unslung

[root@DNS-320L]# ls -l /Alt-F/etc/init.d/
-rwxr-xr-x    1 root     root           516 Mar  9 18:12 S81entware

The log you posted seems to be truncated -- it's not a good idea, logs should be fully posted (attached), so the trained eye will see events that an untrained eye will not.
Anyway, I can see that there are several issues there:
-The first is  "crond[918]: user root: parse error at ..." have you hand edited crontab? What is its content? (verbatim, 'crontab -l' output)
-The second is that hot_aux is restarting services that it should not:

Mar  8 11:34:50 MezelNAS2 user.notice hot_aux: Restarting syslogd:  Stopping klogd: OK. Stopping syslogd: OK. Starting syslogd: OK. Starting klogd: OK.
Mar  8 11:34:53 MezelNAS2 user.notice hot_aux: Restarting urandom:  Stopping urandom: OK. Starting urandom: OK.
Mar  8 11:34:54 MezelNAS2 user.notice hot_aux: Restarting sslcert:  Stopping sslcert: OK. Starting sslcert: OK.
Mar  8 11:34:54 MezelNAS2 user.notice hot_aux: Stopping modload: OK. Starting modload: OK.
Mar  8 11:34:55 MezelNAS2 user.notice hot_aux: Restarting sysctrl:  Stopping sysctrl: OK. Starting sysctrl: OK.

The hot_aux script runs when a filesystem is mounted and an Alt-F folder is found on it. Any bootable services found there will be restarted, so the old firmware running services will be stopped first and the new, updated on disk services started.
There is no reason to restart syslogd, urandom, and sysctrl, as no new updated packages of them have been released! Most certainly they are under /Alt-F/etc/init.d, and you should only find there initscripts from on disk installed packages.
You can remove the others (using the "aufs.sh" stanza) -- unless you are on a DNS-323/321 and have installed the kernel-modules* packages, in that case the modload initscript is legitimate).

After a reboot on my box
[root@DNS-320L]# logread | grep hot
Mar  9 18:19:56 DNS-320L user.debug hot_aux: (18:19:41) Start  fscking sda1
Mar  9 18:19:56 DNS-320L user.debug hot_aux: (18:19:42) Finish fscking sda1: fsck 1.41.14 (22-Dec-2010) UsbStorage: clean, 385/977280 files, 106699/3906250 blocks
Mar  9 18:19:56 DNS-320L user.debug hot_aux: (18:19:42) Public directory found in UsbStorage
Mar  9 18:19:56 DNS-320L user.debug hot_aux: (18:19:42) Alt-F directory found in UsbStorage
Mar  9 18:19:57 DNS-320L user.notice hot_aux: Starting apcupsd... done. 

The kernel has found a new disk and called hot.sh, who called hot_aux.sh that fsck it, mounted it, found an Alt-F folder on it, found /Alt-F/etc/init.d/S81entware and executed it with the "restart" argument.
In your box it also found (and shouldn't) the syslog, urandom, modload and sysctrl initscripts and did the same. So, what is happening in your box that is not happening in mine?

By the way: what is your box model and Alt-F installed version? And previous Alt-F installs that might have left some debris behind it? namely snapshot releases?
I might need you to make a Rx or NMR to your box, but for now a blood sample will be enough :-)


Ram Set

unread,
Mar 12, 2018, 3:33:22 PM3/12/18
to al...@googlegroups.com
ls -/Alt-F/etc/init.d/
 
[root@MezelNAS2]# ls -l /Alt-F/etc/init.d/
total 120
-rwxr-xr-x    1 root     root           758 Mar 18  2015 S10syslog
-rwxr-xr-x    1 root     root           983 Jun  5  2017 S10urandom
-rwxr-xr-x    1 root     root          1535 Jun  5  2017 S11sslcert
-rwxr-xr-x    1 root     root          1968 Sep 22 10:36 S13modload
-rw-r--r--    1 root     root           577 Nov 21  2016 S20hddtemp
-rwxr-xr-x    1 root     root           305 Nov 14  2016 S21sysctrl
-rw-r--r--    1 root     root           474 Mar 18  2015 S26cron
-rw-r--r--    1 root     root           472 Mar 18  2015 S27at
-rwxr-xr-x    1 root     root           573 Mar 18  2015 S28smart
-rw-r--r--    1 root     root           738 Mar 18  2015 S29mdadm
-rwxr-xr-x    1 root     root          1607 Mar 18  2015 S30backup
-rw-r--r--    1 root     root          1115 Mar 18  2015 S31cleanup
-rwxr-xr-x    1 root     root          1250 Jan 31  2016 S31news
-rw-r--r--    1 root     root           796 Mar 18  2015 S40portmap
-rw-r--r--    1 root     root           499 Mar 19  2016 S41http
-rwxr-xr-x    1 root     root          2378 May 11  2017 S41inetd
-rw-r--r--    1 root     root           675 Mar 19  2016 S41stunnel
-rwxr-xr-x    1 root     root          2064 Mar 17  2016 S43ntp
-rw-r--r--    1 root     root           506 Jan 12  2017 S44ddns
-rw-r--r--    1 root     root          1024 Jun 15  2017 S60nsm
-rw-r--r--    1 root     root          2128 Jun 15  2017 S61nfs
-rwxr-xr-x    1 root     root           935 Jun 11  2017 S61smb
-rw-r--r--    1 root     root          1237 Nov 29 17:40 S62dropbear
-rw-r--r--    1 root     root           320 Mar 19  2016 S63rsyncd
-rw-r--r--    1 root     root          1533 Mar 19  2016 S63vsftpd
-rw-r--r--    1 root     root          1407 Jun  5  2017 S69rmount
-rwx------    1 root     root           516 Mar  8 18:17 S81entware
-rw-r--r--    1 root     root          1331 Jun 27  2016 S81syncthing
-rwx------    1 root     root           663 Mar  3 17:22 S98ffp
-rwxr-xr-x    1 root     root          2542 May 29  2016 S99user


ls -l /Alt-F/opt/etc/init.d/

[root@MezelNAS2]# ls -l /Alt-F/opt/etc/init.d/
total 12
-rwxr-xr-x    1 root     root           180 May 30  2017 S17apcupsd
-rwxrwxrwx    1 root     root          2822 May 30  2017 rc.func
-rwxr-xr-x    1 root     root           927 May 30  2017 rc.unslung

cat /tmp/board /etc/Alt-F
 [root@MezelNAS2]# cat /tmp/board /etc/Alt-F
DNS-323-A1
1.0

For the crontab error, I had a space characted on one of the entries that was causing that error. I haven't noticed it 'till i looked at the long. I have fixed that typo as soon as i found out about it.


I do have the additional Kernel Modules installed.


alt-f log attached.
alt-f.log

João Cardoso

unread,
Mar 14, 2018, 12:55:54 PM3/14/18
to Alt-F
Most of all those initscripts shouldn't be there, that's why you see hot_aux restarting most services when the Alt-F folder is found.
I have no idea how they appeared there. You have read the /Alt-F/README.txt file, right?

Try executing the following command

fixup clean # remove stray files under /Alt-F that are not shipped on the fw, are not a conf files, nor files from a disk-installed package

What files remain there?
Only S81entware and S13modload should remain there, assuming that only the kernel-modules package was installed (syncthing seems to be also installed).

Then, using the webUI, Services->User, check the "Boot Enabled" checkbox in the entware entry and hit Submit.
Don't forget to "Save Settings", Reboot and post the system log

The log says you are using  "kernel 4.4.45", so you are using the 1.0 Snapshot.
Please flash the final 1.0, and be sure to read the README, taking special attention to the last paragraph:
...
News:
===
 -updated to linux kernel 4.4.86
...
-If running the 1.0 Snapshot, execute the following commands after flashing the 1.0 Release, in order to update the pre-installed packages list:
  rm /usr/lib/ipkg/.fixed
  ipkg -update

The "System Configuration" log you sent is useful, but it is a boot time only generated log, please post instead the "System Log" and "hot_aux" logs

Ram Set

unread,
Mar 16, 2018, 2:18:13 PM3/16/18
to Alt-F

i ran fixup clean and updated to 1.0 final. 
Entware started on it's own at reboot, after flashing was complete.

I checked ls -l /Alt-F/etc/init.d/ and indeed, I have only S13modload and S81entware there.

As of now, everything works as expected. 

Thank you for the time you took to look into this.

 I didn't even know I was running the NAS on the snapshot.

Reply all
Reply to author
Forward
0 new messages