Skip to content

Commit 1ec19bf

Browse files
committed
Update filepath to use /mnt/jrc-comms/hooks/boot.d
1 parent 40becfc commit 1ec19bf

File tree

1 file changed

+12
-13
lines changed

1 file changed

+12
-13
lines changed

docs/guides/custom-boot-hooks/index.md

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
---
2-
title: Add Custom Boot Hook to /opt/jrc/hooks/boot.d
2+
title: Add Custom Boot Hook to /mnt/jrc-comms/hooks/boot.d
33
---
44

5-
This guide explains how to add a custom boot hook to `/opt/jrc/hooks/boot.d/` in applications that execute scripts in numerical order. Follow these steps to ensure proper execution order and functionality.
5+
This guide explains how to add a custom boot hook to `/mnt/jrc-comms/hooks/boot.d/` in applications that execute scripts in numerical order. Follow these steps to ensure proper execution order and functionality.
66

77
!!! Assumption:
8-
We assume you have root access to modify files in `/opt/jrc/hooks/boot.d/`.
8+
We assume you have root access to modify files in `/mnt/jrc-comms/hooks/boot.d/`.
99
!!!
1010

1111
## Create Custom Boot Hook
@@ -15,15 +15,14 @@ Create a new shell script with a filename starting with `99-` (to ensure it runs
1515

1616
```bash
1717
#!/bin/bash
18-
/opt/jrc/hooks/boot.d/99-custom-task
18+
/mnt/jrc-comms/hooks/boot.d/99-custom-task
1919

2020
echo "Running custom boot task..."
2121
```
2222

2323
### 2. Set Permissions and Ownership
2424
Make the script executable and ensure it’s owned by `root`:
2525

26-
2726
### 3. Verify Execution Order
2827
The application runs scripts in ascending order based on their numeric prefixes. For example:
2928

@@ -43,7 +42,7 @@ To log system time at the end of the boot process:
4342

4443
```bash
4544
#!/bin/bash
46-
/opt/jrc/hooks/boot.d/99-custom-task
45+
/mnt/jrc-comms/hooks/boot.d/99-custom-task
4746

4847
LOGFILE="/var/log/custom-boot.log"
4948
echo "Boot completed at: $(date)" >> $LOGFILE
@@ -55,15 +54,15 @@ echo "Boot completed at: $(date)" >> $LOGFILE
5554
1. **Test your script manually** before relying on the boot process:
5655

5756
```bash
58-
sudo /opt/jrc/hooks/boot.d/99-custom-task
57+
sudo /mnt/jrc-comms/hooks/boot.d/99-custom-task
5958
```
6059

6160
2. **Check logs** for errors (e.g., `/var/log/syslog` or `journalctl`)
6261

6362
3. **Validate script syntax** using:
6463

6564
```bash
66-
bash -n /opt/jrc/hooks/boot.d/99-custom-task
65+
bash -n /mnt/jrc-comms/hooks/boot.d/99-custom-task
6766
```
6867

6968
By following this structure, you can extend the boot process with custom logic while maintaining predictable execution order.
@@ -78,13 +77,13 @@ The following is an example of how you would implement a boot hook script to cre
7877

7978
## Boot Hook Script Implementation
8079

81-
### 1. Create /opt/jrc/hooks/boot.d/99-links Script
80+
### 1. Create /mnt/jrc-comms/hooks/boot.d/99-links Script
8281

8382
Creates bind mounts after filesystems are available
8483

8584
```bash
8685
#!/bin/bash
87-
/opt/jrc/hooks/boot.d/99-links
86+
/mnt/jrc-comms/hooks/boot.d/99-links
8887

8988
echo "Creating bind mounts..."
9089
mount --bind /var/www/domain.com/shared/var/salesexport /home/user/salesexport
@@ -94,15 +93,15 @@ mount --bind /var/www/domain.com/shared/media/importexport /home/user/importexpo
9493
### 2. Set Permissions
9594

9695
```bash
97-
sudo chmod +x /opt/jrc/hooks/boot.d/99-links
98-
sudo chown root:root /opt/jrc/hooks/boot.d/99-links
96+
sudo chmod +x /mnt/jrc-comms/hooks/boot.d/99-links
97+
sudo chown root:root /mnt/jrc-comms/hooks/boot.d/99-links
9998
```
10099

101100
## Verification
102101
1. **Validate script syntax**:
103102

104103
```bash
105-
bash -n /opt/jrc/hooks/boot.d/99-custom-task
104+
bash -n /mnt/jrc-comms/hooks/boot.d/99-custom-task
106105
```
107106

108107
2. **Check active mounts**:

0 commit comments

Comments
 (0)