Skip to content

Commit 5b480ce

Browse files
committed
[?] Update section on running the server
1 parent 2cb0262 commit 5b480ce

File tree

1 file changed

+69
-24
lines changed

1 file changed

+69
-24
lines changed

docs/getting_started/running.md

Lines changed: 69 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,63 +1,108 @@
11
#
22

3-
The iRODS Server can be run in one of three modes:
3+
## Starting the Server
44

5-
- [Syslog Mode](#syslog-mode)
6-
- [Standard Output Mode](#standard-output-mode)
7-
- [Test Mode](#test-mode)
5+
The iRODS server can be started in several ways, but the most common form is as a daemon process. This is accomplished by running the following as the service account user.
86

9-
## Syslog Mode
10-
This mode is the default when operating the iRODS Server.
7+
```bash
8+
irodsServer -d
9+
```
10+
11+
The server will perform various checks during startup to make sure it is safe to accept client requests. The most important check is validation of `server_config.json`. Failing validation will result in the server terminating immediately. All validation errors are reported via stderr.
12+
13+
Logs are written to syslog. See [The Server Log](../../system_overview/troubleshooting/#the-server-log) for information regarding syslog.
14+
15+
### Server PID File
16+
17+
When running properly, the server writes its process ID (PID) to:
18+
19+
```
20+
/var/run/irods/irods-server.pid
21+
```
22+
23+
You can change the location by using the `--pid-file` option. This is useful when running multiple iRODS servers on the same host.
24+
25+
## Stopping the Server
1126

12-
This mode instructs the server and all of its children to write log messages to **syslog**.
27+
iRODS supports two modes of shutdown.
1328

14-
syslog can be configured to write messages locally, remotely, or both.
29+
### Fast Shutdown
30+
31+
A fast shutdown is triggered by sending a `SIGTERM` or `SIGINT` to the main server process. For example:
1532

1633
```bash
17-
$ ./irodsctl start
34+
kill -TERM $(cat /var/run/irods/irods-server.pid)
1835
```
1936

20-
Messages can be rotated on a regular basis, most commonly through the **logrotate** service.
37+
This signal instructs agents to complete their current client request and terminate immediately (and cleanly), ending communication with the client.
38+
39+
### Graceful Shutdown
2140

22-
## Standard Output Mode
23-
This mode instructs the server and all of its children to write log messages to **stdout** instead of **syslog**. This mode can be enabled in two ways.
41+
A graceful shutdown is triggered by sending a `SIGQUIT` to the main server process. For example:
2442

25-
### Option 1 (recommended) - Use the control script in the iRODS service account
2643
```bash
27-
$ ./irodsctl start --stdout
44+
kill -QUIT $(cat /var/run/irods/irods-server.pid)
2845
```
2946

30-
### Option 2 - Launch the server binary directly
47+
This signal instructs agents to wait a limited amount of time before entering the [fast shutdown](#fast-shutdown) phase. During a graceful shutdown, agents will continue servicing client requests until the timeout. The timeout can be modified via the `graceful_shutdown_timeout_in_seconds` configuration property in `server_config.json`. See the section about [configuration](../../system_overview/configuration/#etcirodsserver_configjson) to learn more.
48+
49+
## Reloading Server Configuration
50+
51+
Unlike iRODS 4, iRODS 5 does not automatically load changes to `server_config.json`. Reloading the server's configuration requires sending a `SIGHUP` to the server. For example:
52+
3153
```bash
32-
$ /usr/sbin/irodsServer -u
54+
kill -HUP $(cat /var/run/irods/irods-server.pid)
3355
```
3456

35-
Regardless of the method, it is important to remember that once the server has been launched in this mode, the terminal will not return control until the server is shutdown or killed.
57+
On receiving `SIGHUP`, the server:
58+
59+
1. Validates `server_config.json` against its schema.
60+
2. If validation **fails**, the reload is **rejected** and the previous configuration is used.
61+
3. If validation **succeeds**, the server:
62+
63+
- Updates its in-memory configuration
64+
- Sends `SIGTERM` to the delay server (if running)
65+
- Sends `SIGQUIT` to the agent factory
66+
- Waits for the agent factory to close its listening socket
67+
- Launches a new agent factory
68+
69+
## Using the Service Manager
70+
71+
TODO
3672

3773
## Test Mode
74+
75+
!!! Note
76+
This section is primarily for developers working on the server, plugins, and/or clients.
77+
3878
This mode instructs the server to write all log messages to an additional log file. Messages will still be written to stdout or syslog depending on how the server was launched. This secondary log file is located at the following location:
79+
3980
```bash
4081
/var/lib/irods/log/test_mode_output.log
4182
```
4283

43-
This mode was introduced to guarantee that log messages appear in the log file immediately. This mode is only meant to be used for testing. The log file produced by this mode is never rotated.
84+
This mode was introduced to guarantee that log messages appear in the log file immediately. This mode is only meant to be used for testing. **The log file produced by this mode is never rotated.**
4485

4586
To enable this mode, you must first define the following environment variable in the iRODS service account:
87+
4688
```bash
4789
export IRODS_ENABLE_TEST_MODE=1
4890
```
49-
This environment variable instructs the IrodsController python class to start the server in test mode.
91+
92+
This environment variable makes various components (e.g. `IrodsController`) aware the server is to be operated in test mode. This is very important for tests which restart the server.
5093

5194
**If you are using the run_tests.py script to run tests, then you can ignore the rest of this section because run_tests.py restarts the server in test mode automatically.**
5295

53-
Next, you'll want to start (or restart) the server in test mode. This can be done using either of the following methods.
96+
Next, you'll want to start (or restart) the server in test mode.
5497

55-
### Option 1 (recommended) - Use the control script in the iRODS service account
5698
```bash
57-
$ ./irodsctl start --test
99+
irodsServer -t
58100
```
59101

60-
### Option 2 - Launch the server binary directly
102+
## Additional Information
103+
104+
For more options and information, see the server's built-in help:
105+
61106
```bash
62-
$ /usr/sbin/irodsServer -t
107+
irodsServer --help
63108
```

0 commit comments

Comments
 (0)