mirror of
https://github.com/JakeHillion/scx.git
synced 2024-11-29 20:50:22 +00:00
Merge pull request #109 from sirlucjan/services-rework
Reworking systemd-service and adding a config file
This commit is contained in:
commit
46ba5908ab
@ -3,30 +3,42 @@
|
||||
This guide provides instructions for running the SCX schedulers as a systemd service and checking its logs.
|
||||
|
||||
## Getting Started
|
||||
|
||||
At the very beginning, configure the /etc/default/scx file:
|
||||
|
||||
- in the SCX_SCHEDULER variable, select the scheduler you are interested in
|
||||
|
||||
- in the SCX_FLAGS variable, specify the flags you want to add. To do this, execute and read what flags you can add.
|
||||
|
||||
```
|
||||
scx_SCHEDNAME --help
|
||||
```
|
||||
|
||||
To start the SCX scheduler at boot, you need to run the systemd service as root. Here are the steps:
|
||||
|
||||
|
||||
- Enable the service:
|
||||
|
||||
```
|
||||
systemctl enable scx_SCHEDNAME
|
||||
systemctl enable scx.service
|
||||
```
|
||||
|
||||
- Start the service:
|
||||
|
||||
```
|
||||
systemctl start scx_SCHEDNAME
|
||||
systemctl start scx.service
|
||||
```
|
||||
|
||||
Alternatively, you can use a shortened version of these commands:
|
||||
|
||||
```
|
||||
systemctl enable --now scx_SCHEDNAME
|
||||
systemctl enable --now scx.service
|
||||
```
|
||||
|
||||
- To check the status of the service, use the following command:
|
||||
|
||||
```
|
||||
systemctl status scx_SCHEDNAME
|
||||
systemctl status scx.service
|
||||
```
|
||||
|
||||
## Checking Journald Logs
|
||||
|
@ -2,7 +2,7 @@ systemd_system_unit_dir = systemd.get_variable(pkgconfig : 'systemdsystemunitdir
|
||||
|
||||
install_data(
|
||||
[
|
||||
'scx_central.service', 'scx_flatcg.service', 'scx_nest.service', 'scx_pair.service', 'scx_qmap.service', 'scx_rustland.service', 'scx_rusty.service', 'scx_simple.service', 'scx_userland.service',
|
||||
'scx.service',
|
||||
],
|
||||
install_dir: systemd_system_unit_dir
|
||||
)
|
||||
@ -14,3 +14,9 @@ systemd_system_unit_dir = systemd.get_variable(pkgconfig : 'systemdsystemunitdir
|
||||
install_dir: '/etc/systemd'
|
||||
)
|
||||
|
||||
install_data(
|
||||
[
|
||||
'scx',
|
||||
],
|
||||
install_dir: '/etc/default'
|
||||
)
|
||||
|
5
services/scx
Normal file
5
services/scx
Normal file
@ -0,0 +1,5 @@
|
||||
# List of scx_schedulers: scx_central scx_flatcg scx_layered scx_nest scx_pair scx_qmap scx_rustland scx_rusty scx_simple scx_userland
|
||||
SCX_SCHEDULER=scx_rusty
|
||||
|
||||
# Set custom flags for each scheduler, below is an example of how to use
|
||||
#SCX_FLAGS='-s 3000 -i 0.5 -I 0.025 -l 0.5 -b -k'
|
14
services/scx.service
Normal file
14
services/scx.service
Normal file
@ -0,0 +1,14 @@
|
||||
[Unit]
|
||||
Description=Start scx_scheduler
|
||||
ConditionPathIsDirectory=/sys/kernel/sched_ext
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
EnvironmentFile=/etc/default/scx
|
||||
ExecStart=/bin/bash -c 'exec $SCX_SCHEDULER $SCX_FLAGS '
|
||||
Restart=always
|
||||
StandardError=journal
|
||||
LogNamespace=sched-ext
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
@ -1,14 +0,0 @@
|
||||
[Unit]
|
||||
Description=Start scx_central
|
||||
ConditionPathIsDirectory=/sys/kernel/sched_ext
|
||||
Conflicts=scx_flatcg.service scx_nest.service scx_pair.service scx_qmap.service scx_rustland.service scx_rusty.service scx_simple.service scx_userland.service
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
ExecStart=scx_central
|
||||
Restart=always
|
||||
StandardError=journal
|
||||
LogNamespace=sched-ext
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
@ -1,14 +0,0 @@
|
||||
[Unit]
|
||||
Description=Start scx_flatcg
|
||||
ConditionPathIsDirectory=/sys/kernel/sched_ext
|
||||
Conflicts=scx_central.service scx_nest.service scx_pair.service scx_qmap.service scx_rustland.service scx_rusty.service scx_simple.service scx_userland.service
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
ExecStart=scx_flatcg
|
||||
Restart=always
|
||||
StandardError=journal
|
||||
LogNamespace=sched-ext
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
@ -1,14 +0,0 @@
|
||||
[Unit]
|
||||
Description=Start scx_nest
|
||||
ConditionPathIsDirectory=/sys/kernel/sched_ext
|
||||
Conflicts=scx_central.service scx_flatcg.service scx_pair.service scx_qmap.service scx_rustland.service scx_rusty.service scx_simple.service scx_userland.service
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
ExecStart=scx_nest
|
||||
Restart=always
|
||||
StandardError=journal
|
||||
LogNamespace=sched-ext
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
@ -1,14 +0,0 @@
|
||||
[Unit]
|
||||
Description=Start scx_pair
|
||||
ConditionPathIsDirectory=/sys/kernel/sched_ext
|
||||
Conflicts=scx_central.service scx_flatcg.service scx_nest.service scx_qmap.service scx_rustland.service scx_rusty.service scx_simple.service scx_userland.service
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
ExecStart=scx_pair
|
||||
Restart=always
|
||||
StandardError=journal
|
||||
LogNamespace=sched-ext
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
@ -1,14 +0,0 @@
|
||||
[Unit]
|
||||
Description=Start scx_qmap
|
||||
ConditionPathIsDirectory=/sys/kernel/sched_ext
|
||||
Conflicts=scx_central.service scx_flatcg.service scx_nest.service scx_pair.service scx_rustland.service scx_rusty.service scx_simple.service scx_userland.service
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
ExecStart=scx_qmap
|
||||
Restart=always
|
||||
StandardError=journal
|
||||
LogNamespace=sched-ext
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
@ -1,14 +0,0 @@
|
||||
[Unit]
|
||||
Description=Start scx_rustland
|
||||
ConditionPathIsDirectory=/sys/kernel/sched_ext
|
||||
Conflicts=scx_central.service scx_flatcg.service scx_nest.service scx_pair.service scx_qmap.service scx_rusty.service scx_simple.service scx_userland.service
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
ExecStart=scx_rustland
|
||||
Restart=always
|
||||
StandardError=journal
|
||||
LogNamespace=sched-ext
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
@ -1,14 +0,0 @@
|
||||
[Unit]
|
||||
Description=Start scx_rusty
|
||||
ConditionPathIsDirectory=/sys/kernel/sched_ext
|
||||
Conflicts=scx_central.service scx_flatcg.service scx_nest.service scx_pair.service scx_qmap.service scx_rustland.service scx_simple.service scx_userland.service
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
ExecStart=scx_rusty
|
||||
Restart=always
|
||||
StandardError=journal
|
||||
LogNamespace=sched-ext
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
@ -1,14 +0,0 @@
|
||||
[Unit]
|
||||
Description=Start scx_simple
|
||||
ConditionPathIsDirectory=/sys/kernel/sched_ext
|
||||
Conflicts=scx_central.service scx_flatcg.service scx_nest.service scx_pair.service scx_qmap.service scx_rustland.service scx_rusty.service scx_userland.service
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
ExecStart=scx_simple
|
||||
Restart=always
|
||||
StandardError=journal
|
||||
LogNamespace=sched-ext
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
@ -1,14 +0,0 @@
|
||||
[Unit]
|
||||
Description=Start scx_userland
|
||||
ConditionPathIsDirectory=/sys/kernel/sched_ext
|
||||
Conflicts=scx_central.service scx_flatcg.service scx_nest.service scx_pair.service scx_qmap.service scx_rustland.service scx_rusty.service scx_simple.service
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
ExecStart=scx_userland
|
||||
Restart=always
|
||||
StandardError=journal
|
||||
LogNamespace=sched-ext
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
Loading…
Reference in New Issue
Block a user