Hi,
I am referring these docs to make startup script but since my *launch.sh file is on SD card.
so the mavros.service starts before the mounting service. to counter this I added
could you please briefly describe the use-case, what’s the scenario for running this script.
are you able to run the script file, /home/odroid/scripts/startup_launch.sh manually?
Hi, yes I can run the script file manually. and if I manually start the service, it works in that case as well. the use case is to start the mavros service
Hi, the problem is, the service is called before SD card is mounted, since other SBC’s are booted from SD card self (Raspberry Pi) less info is available for this problem
I’ve not worked on this, but here is a command you’ll be interested in looking at: systemctl list-units | egrep -i 'mount'
On a TX2 (might differ from AGX, but likely is the same) I see:
# systemctl list-units | egrep -i mount
proc-sys-fs-binfmt_misc.automount loaded active running Arbitrary Executable File Formats File System Automount Point
-.mount loaded active mounted Root Mount
dev-hugepages.mount loaded active mounted Huge Pages File System
dev-mqueue.mount loaded active mounted POSIX Message Queue File System
proc-sys-fs-binfmt_misc.mount loaded active mounted Arbitrary Executable File Formats File System
run-rpc_pipefs.mount loaded active mounted RPC Pipe File System
run-user-0.mount loaded active mounted /run/user/0
run-user-120.mount loaded active mounted /run/user/120
sys-kernel-config.mount loaded active mounted Kernel Configuration File System
sys-kernel-debug.mount loaded active mounted Kernel Debug File System
systemd-remount-fs.service loaded active exited Remount Root and Kernel File Systems
The ones you will be interested in for an SD card might be run one of two ways:
As an individual user (the service mounts under “/run/user/<user ID>”), or
As the system (no “/run” file, part of fstab).
Note that mounting as an individual user occurs later than regular mount, and is typical of an SD card which is not the root filesystem. Probably this is what happens in your case.
If this runs as an individual user, then the mount point is the user’s ID number (UID) as the subdirectory of “/run/user”. So if a mount shows up under “/run/user/0”, then this is a late mount by user root; if this is showing up as a numeric ID other than 0, then this is running as that user. On the system I am looking at the Gnome Display manager has UID 120:
Thus this is an automount based on the user logging in to the desktop. This needs to instead be mounted via “fstab” so that it can mount earlier. One problem is that sometimes automount needs to be disabled if you are mounting via fstab (sometimes automount will incorrectly mount the SD card twice). When the SD is mounted automatically, what do you see from: df -H -T /media/agx/myfolder
Also, what do you see from: lsblk -f
From the above we can find out the best way to add an entry to fstab.