π System Startup
MOS provides dedicated hooks that are executed during system startup. These hooks allow controlled customization of the boot process.
π Post-Start Script (post-start.sh)β
The Post-Start Script is executed after system startup has completed.
It runs after all storage pools are mounted and after all services have been started. This makes it suitable for tasks that require a fully initialized system environment.
π Script Locationβ
/boot/optional/scripts/post-start.sh
If this file exists, MOS will automatically execute it during every system startup.
β±οΈ Execution Orderβ
The Post-Start Script is executed in the following phase:
- Storage pools are mounted
- Docker, LXC, VMs, and system services are started
- Post-Start Script is executed
At this stage, the full system environment is available.
π§ Typical Use Casesβ
- Starting custom services or applications
- Running system checks after startup
- Applying configurations that depend on mounted storage
- Interacting with containers or virtual machines
- Triggering notifications after system startup
- Custom monitoring or logging tasks
π§ Recommended Usageβ
While MOS provides startup scripts, Cron jobs are preferred for most automation tasks.
Cron jobs:
- Are easier to maintain
- Provide better logging and error handling
- Can be scheduled or delayed
- Reduce the risk of startup-related issues
Use the Post-Start Script only when an action must run immediately after system startup.
π Script Execution Notesβ
- The script does not need to be executable
- No
chmod +xis required - Script execution is handled internally by MOS
The script will be executed automatically as long as the file exists at the defined path.
β οΈ Important Notesβ
- Long-running commands may delay system readiness
- Errors in this script can affect dependent services
- Keep execution time short and predictable
Parts of this documentation were created with the assistance of AI tools. All AI-generated content has undergone review, but it may still contain inaccuracies, omissions, or outdated information.