[SCRIPT] create-autorun.sh
-
- Starting out
- Posts: 17
- Joined: Sat Nov 04, 2017 7:24 am
Re: [SCRIPT] create-autorun.sh
I found the issue, erroneous carriage return on one of the lines. All is well now.
- OneCD
- Guru
- Posts: 12143
- Joined: Sun Aug 21, 2016 10:48 am
- Location: "... there, behind that sofa!"
-
- New here
- Posts: 8
- Joined: Mon Oct 22, 2018 11:49 pm
Re: [SCRIPT] create-autorun.sh
I have been trying to run this on TS-231P2, but fail with:
* script version : 181102
* NAS model : TS-X31P2 (TS-231P2)
* QTS version : 4.3.6 #20190328
* default volume : /share/CACHEDEV1_DATA
√ DOM partition found : /dev/mtd6
X Unable to mount (ext4) DOM partition (/dev/mmcblk0p7)! Error: [mount: mounting ubi2:config on /tmp/create-autorun.HjebKJ failed: No such device]
X autorun.sh creation failed!
- OneCD
- Guru
- Posts: 12143
- Joined: Sun Aug 21, 2016 10:48 am
- Location: "... there, behind that sofa!"
Re: [SCRIPT] create-autorun.sh
Can you please run this and post the output?
Code: Select all
cat /etc/platform.conf
-
- New here
- Posts: 8
- Joined: Mon Oct 22, 2018 11:49 pm
Re: [SCRIPT] create-autorun.sh
here is the content:OneCD wrote: ↑Sun Apr 28, 2019 3:59 amCan you please run this and post the output?Code: Select all
cat /etc/platform.conf
Platform = ARM_AL
SUID = 8300974ab1c56c01e84068778f78831f
[DIMM 1]
valid = 1
channel_id = 1
slot_id = 1
slot_addr = 0x52
type = 11
speed = 5
module_type = 3
ecc = 0
size = 4096
manufaturer = Transcend Information
[FIRMWARE STORAGE]
DEVICE_NODE = /dev/mtd
FS_TYPE = ubifs
UPDATE_TMP_PARTITION = 5
FS_ACTIVE_PARTITION = 3
FS_RECOVERY_PID = -1
[CONFIG STORAGE]
DEVICE_NODE = /dev/mtd
FS_TYPE = ubifs
FS_ACTIVE_PARTITION = 6
[MISC]
DISPLAY_NAME = TS-231P2
- OneCD
- Guru
- Posts: 12143
- Joined: Sun Aug 21, 2016 10:48 am
- Location: "... there, behind that sofa!"
Re: [SCRIPT] create-autorun.sh
And this one please?
We'll then try a manual DOM mount (I'll provide the commands to use), so we can see where this is going wrong.
Code: Select all
blkid
-
- New here
- Posts: 8
- Joined: Mon Oct 22, 2018 11:49 pm
Re: [SCRIPT] create-autorun.sh
here you go:OneCD wrote: ↑Mon Apr 29, 2019 3:48 am And this one please?We'll then try a manual DOM mount (I'll provide the commands to use), so we can see where this is going wrong.Code: Select all
blkid
Code: Select all
# blkid
/dev/dm-0: LABEL="Data" UUID="3debdf22-03de-4258-8583-4de0b98464e6" TYPE="ext4"
/dev/dm-8: LABEL="Data" UUID="3debdf22-03de-4258-8583-4de0b98464e6" TYPE="ext4"
/dev/dm-7: LABEL="Data" UUID="3debdf22-03de-4258-8583-4de0b98464e6" TYPE="ext4"
/dev/dm-6: LABEL="Data" UUID="3debdf22-03de-4258-8583-4de0b98464e6" TYPE="ext4"
/dev/dm-5: LABEL="Data" UUID="3debdf22-03de-4258-8583-4de0b98464e6" TYPE="ext4"
/dev/dm-4: LABEL="Data" UUID="3debdf22-03de-4258-8583-4de0b98464e6" TYPE="ext4"
/dev/md322: UUID="9690300c-9ba0-4e96-8195-7947f89d2a0c" TYPE="swap"
/dev/md256: UUID="b4bdf861-5597-418b-9238-97594f6027e3" TYPE="swap"
/dev/md13: UUID="170e69ff-71ac-4f94-85f6-331a776335c3" TYPE="ext3"
/dev/md9: UUID="6a443ea9-9061-4592-b4c1-d2c3d65bfd33" TYPE="ext4"
/dev/sdb5: UUID="9690300c-9ba0-4e96-8195-7947f89d2a0c" TYPE="swap"
/dev/sdb4: UUID="170e69ff-71ac-4f94-85f6-331a776335c3" TYPE="ext3"
/dev/sdb2: UUID="b4bdf861-5597-418b-9238-97594f6027e3" TYPE="swap"
/dev/sdb1: UUID="6a443ea9-9061-4592-b4c1-d2c3d65bfd33" TYPE="ext4"
/dev/sda5: UUID="9690300c-9ba0-4e96-8195-7947f89d2a0c" TYPE="swap"
/dev/sda4: UUID="170e69ff-71ac-4f94-85f6-331a776335c3" TYPE="ext3"
/dev/sda2: UUID="b4bdf861-5597-418b-9238-97594f6027e3" TYPE="swap"
/dev/sda1: UUID="6a443ea9-9061-4592-b4c1-d2c3d65bfd33" TYPE="ext4"
/dev/mapper/cachedev1: LABEL="Data" UUID="3debdf22-03de-4258-8583-4de0b98464e6" TYPE="ext4"
/dev/mapper/vg1-lv1: LABEL="Data" UUID="3debdf22-03de-4258-8583-4de0b98464e6" TYPE="ext4"
/dev/mapper/vg1-tp1: LABEL="Data" UUID="3debdf22-03de-4258-8583-4de0b98464e6" TYPE="ext4"
/dev/mapper/vg1-tp1-tpool: LABEL="Data" UUID="3debdf22-03de-4258-8583-4de0b98464e6" TYPE="ext4"
/dev/mapper/vg1-tp1_tierdata_2: LABEL="Data" UUID="3debdf22-03de-4258-8583-4de0b98464e6" TYPE="ext4"
/dev/mapper/vg1-tp1_tierdata_2_fcorig: LABEL="Data" UUID="3debdf22-03de-4258-8583-4de0b98464e6" TYPE="ext4"
- OneCD
- Guru
- Posts: 12143
- Joined: Sun Aug 21, 2016 10:48 am
- Location: "... there, behind that sofa!"
Re: [SCRIPT] create-autorun.sh
The correct sequence for your model should be:
Please try these commands in order.
Some QNAP models report UBIFS for the DOM filesystem but really use EXT4, so if the previous 'mount' command failed, try:
You should see failures for both mount commands, as they have already been tried in the [create-autorun.sh] script. Can you please run them anyway and post the results back here? Running them manually will provide a bit more information.
Code: Select all
mkdir /tmp/dom.tmp
ubiattach -m 6 -d 2
mount -vt ubifs ubi2:config /tmp/dom.tmp
Some QNAP models report UBIFS for the DOM filesystem but really use EXT4, so if the previous 'mount' command failed, try:
Code: Select all
mount -vt ext4 /dev/mmcblk0p7 /tmp/dom.tmp
-
- New here
- Posts: 8
- Joined: Mon Oct 22, 2018 11:49 pm
Re: [SCRIPT] create-autorun.sh
this explains what's going wrong:
I have busybox installed, and it looks like there's a replaced version of 'ubiattach' that requires a different parameter set.
maybe you can specify the full path to the original '/sbin/ubiattach' in your script, as that one works correct:
Code: Select all
# mkdir /tmp/dom.tmp
# ubiattach -m 6 -d 2
BusyBox v1.28.1 (2018-02-15 14:34:02 CET) multi-call binary.
Usage: ubiattach -m MTD_NUM [-d UBI_NUM] [-O VID_HDR_OFF] UBI_CTRL_DEV
Attach MTD device to UBI
-m MTD_NUM MTD device number to attach
-d UBI_NUM UBI device number to assign
-O VID_HDR_OFF VID header offset
✗(1) # mount -vt ubifs ubi2:config /tmp/dom.tmp
mount: mounting ubi2:config on /tmp/dom.tmp failed: No such device
✗(255) # which ubiattach
/share/linux/tools/busybox/ubiattach
maybe you can specify the full path to the original '/sbin/ubiattach' in your script, as that one works correct:
Code: Select all
# /sbin/ubiattach -m 6 -d 2
UBI device number 2, total 120 LEBs (15237120 bytes, 14.5 MiB), available 0 LEBs (0 bytes), LEB size 126976 bytes (124.0 KiB)
# mount -vt ubifs ubi2:config /tmp/dom.tmp
- OneCD
- Guru
- Posts: 12143
- Joined: Sun Aug 21, 2016 10:48 am
- Location: "... there, behind that sofa!"
- OneCD
- Guru
- Posts: 12143
- Joined: Sun Aug 21, 2016 10:48 am
- Location: "... there, behind that sofa!"
Re: [SCRIPT] create-autorun.sh
This is now complete. Can you please try the latest script?
-
- New here
- Posts: 8
- Joined: Mon Oct 22, 2018 11:49 pm
Re: [SCRIPT] create-autorun.sh
initially this now ran into issues again, due to the manual commands I had executed before:
Code: Select all
create-autorun.sh (190506)
[ info ] NAS model: TS-X31P2 (TS-231P2)
[ info ] QTS version: 4.3.6 #20190328
[ info ] default volume: /share/CACHEDEV1_DATA
[ done ] DOM partition found (/dev/mtd6)
[ fail ] Unable to ubiattach! [ubiattach: error!: cannot attach mtd6
error 17 (File exists)]
[ info ] will try as (ext4) instead
[ fail ] Unable to mount (ext4) DOM partition (/dev/mmcblk0p7)! Error: [mount: special device /dev/mmcblk0p7 does not exist]
[ fail ] [autorun.sh] creation failed!
Code: Select all
# /sbin/ubidetach -m 6
thanks for your help!
- OneCD
- Guru
- Posts: 12143
- Joined: Sun Aug 21, 2016 10:48 am
- Location: "... there, behind that sofa!"
Re: [SCRIPT] create-autorun.sh
The script is used to make a successful 'ubiattach', which is followed shortly after by a corresponding (and automated) 'ubidetach'.
Yours is a case of me forgetting to mention to 'ubidetach' afterward. But it's not a situation I anticipate the script causing, or needing to manage on its own.
Thanks for reporting and testing this. We've made it better.
-
- New here
- Posts: 4
- Joined: Sat Jun 01, 2019 3:11 am
Re: [SCRIPT] create-autorun.sh
Thanks for this it's saved me quite some headache in setting things up - however I'm trying to run a node.js app as part of the startup but don't seem to be having much luck
I've made a simple script and added it to the scripts folder and set the executable permission, it's basically a one-liner e.g.:
Checking the logs the script is being found and run but the app itself doesn't actually execute, if I SSH into the QNAP (TS-431P off the top of my head) and manually run autostart.sh or my own script everything works fine.
Reading around I've seen some mention of node not being available on boot but I'm not too clear on how to get around that (delaying autostart perhaps?) or if there's some other way to do this - would you have any ideas or experience around this?
Any help would be greatly appreciated, thank you
I've made a simple script and added it to the scripts folder and set the executable permission, it's basically a one-liner e.g.:
Code: Select all
node /myDir/myApp/myapp.js &
Reading around I've seen some mention of node not being available on boot but I'm not too clear on how to get around that (delaying autostart perhaps?) or if there's some other way to do this - would you have any ideas or experience around this?
Any help would be greatly appreciated, thank you
- OneCD
- Guru
- Posts: 12143
- Joined: Sun Aug 21, 2016 10:48 am
- Location: "... there, behind that sofa!"
Re: [SCRIPT] create-autorun.sh
Hi and welcome to the forum.
For your use-case, suggest trying the RunLast QPKG instead.
NodeJS isn't available when [autorun.sh] is executed. QPKGs are reintegrated into QTS after [autorun.sh].
For your use-case, suggest trying the RunLast QPKG instead.