Forked from houtianze/sysv.init.script.to.systemd.unit.file.md
Created
January 26, 2024 07:33
-
-
Save MVKozlov/4e35a2fef1d867c1e79b9b2af4db6f4c to your computer and use it in GitHub Desktop.
Revisions
-
houtianze revised this gist
Oct 17, 2016 . 1 changed file with 1 addition and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -12,4 +12,5 @@ Let's say you have a `SysV Init Script` named `foo` ``` 6. Enable the service: `systemd enable foo.service` 7. (Optional) You can then remove the SysV script by running `chkconfig foo off && chkconfig --del foo`
-
houtianze revised this gist
Oct 17, 2016 . 1 changed file with 7 additions and 4 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,12 +1,15 @@ Let's say you have a `SysV Init Script` named `foo` 1. Copy the file to `/etc/init.d/foo` 2. Enable the SysV service: `chkconfig --add foo` 3. Enable the SysV service: `chkconfig foo on` 4. Start the service: `service foo start`. After this, systemd-sysv-generator will generate this file `/run/systemd/generator.late/foo.service`, copy this file to `/etc/systemd/system` by running: `cp /run/systemd/generator.late/foo.service /etc/systemd/system/foo.service` 5. Edit `/etc/systemd/system/foo.service` by running `systemctl edit foo.service`, add in the following line to `foo.servie` (this makes the service installable) ``` [Install] WantedBy=multi-user.target ``` 6. Enable the service: `systemd enable foo.service`
-
houtianze revised this gist
Sep 22, 2016 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -8,5 +8,5 @@ Let's say the `SysV Init Script` is called foo (the file `/etc/init.d/foo`): WantedBy=multi-user.target ``` 3. Enable the service: `systemd enable foo.service`
-
houtianze revised this gist
Sep 22, 2016 . 1 changed file with 3 additions and 4 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,13 +1,12 @@ Let's say the `SysV Init Script` is called foo (the file `/etc/init.d/foo`): 1. systemd-sysv-generator will generate this file `/run/systemd/generator.late/foo.service`, copy this file to `/etc/systemd/system` by running: `cp /run/systemd/generator.late/foo.service /etc/systemd/system/foo.service` 2. Edit `/etc/systemd/system/foo.service` by running `systemctl edit foo.service`, add in the following line to `foo.servie` (this makes the service installable) ``` [Install] WantedBy=multi-user.target ``` 3. Enable the server: `systemd enable foo.service`
-
houtianze revised this gist
Sep 22, 2016 . 1 changed file with 2 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -3,9 +3,11 @@ Let's say the `SysV Init Script` is called foo (the file `/etc/init.d/foo`): 1. Start the service through Systemd: `systemctl start foo` 2. systemd-sysv-generator will generate this file `/run/systemd/generator.late/foo.service`, copy this file to `/etc/systemd/system` by running: `cp /run/systemd/generator.late/foo.service /etc/systemd/system/foo.service` 3. Edit `/etc/systemd/system/foo.service` by running `systemctl edit foo.service`, add in the following line to `foo.servie` (this makes the service installable) ``` [Install] WantedBy=multi-user.target ``` 4. Enable the server: `systemd enable foo.service`
-
houtianze revised this gist
Sep 22, 2016 . 1 changed file with 5 additions and 4 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -2,9 +2,10 @@ Let's say the `SysV Init Script` is called foo (the file `/etc/init.d/foo`): 1. Start the service through Systemd: `systemctl start foo` 2. systemd-sysv-generator will generate this file `/run/systemd/generator.late/foo.service`, copy this file to `/etc/systemd/system` by running: `cp /run/systemd/generator.late/foo.service /etc/systemd/system/foo.service` 3. Edit `/etc/systemd/system/foo.service` by running `systemctl edit foo.service`, add in the following line to `foo.servie` (this makes the service installable) ``` [Install] WantedBy=multi-user.target ``` 4. Enable the server: `systemd enable foo.service`
-
houtianze revised this gist
Sep 21, 2016 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -2,9 +2,9 @@ Let's say the `SysV Init Script` is called foo (the file `/etc/init.d/foo`): 1. Start the service through Systemd: `systemctl start foo` 2. systemd-sysv-generator will generate this file `/run/systemd/generator.late/foo.service`, copy this file to `/etc/systemd/system` by running: `cp /run/systemd/generator.late/foo.service /etc/systemd/system/foo.service` 3. Edit `/etc/systemd/system/foo.service` by running `systemctl edit foo.service`, add in the following line to `foo.servie` (this makes the service installable)` [Install] WantedBy=multi-user.target ` 4. Enable the server: `systemd enable foo.service`
-
houtianze revised this gist
Sep 21, 2016 . 1 changed file with 2 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -2,7 +2,8 @@ Let's say the `SysV Init Script` is called foo (the file `/etc/init.d/foo`): 1. Start the service through Systemd: `systemctl start foo` 2. systemd-sysv-generator will generate this file `/run/systemd/generator.late/foo.service`, copy this file to `/etc/systemd/system` by running: `cp /run/systemd/generator.late/foo.service /etc/systemd/system/foo.service` 3. Edit `/etc/systemd/system/foo.service` by running `systemctl edit foo.service`, add in the following line to `foo.servie` (this makes the service installable)``` [Install] WantedBy=multi-user.target ``` 4. Enable the server: `systemd enable foo.service` -
houtianze revised this gist
Sep 21, 2016 . 1 changed file with 3 additions and 5 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -2,10 +2,8 @@ Let's say the `SysV Init Script` is called foo (the file `/etc/init.d/foo`): 1. Start the service through Systemd: `systemctl start foo` 2. systemd-sysv-generator will generate this file `/run/systemd/generator.late/foo.service`, copy this file to `/etc/systemd/system` by running: `cp /run/systemd/generator.late/foo.service /etc/systemd/system/foo.service` 3. Edit `/etc/systemd/system/foo.service` by running `systemctl edit foo.service`, add in the following line to `foo.servie` (this makes the service installable)```[Install] WantedBy=multi-user.target ``` 4. Enable the server: `systemd enable foo.service` -
houtianze revised this gist
Sep 21, 2016 . 1 changed file with 4 additions and 4 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -3,9 +3,9 @@ Let's say the `SysV Init Script` is called foo (the file `/etc/init.d/foo`): 1. Start the service through Systemd: `systemctl start foo` 2. systemd-sysv-generator will generate this file `/run/systemd/generator.late/foo.service`, copy this file to `/etc/systemd/system` by running: `cp /run/systemd/generator.late/foo.service /etc/systemd/system/foo.service` 3. Edit `/etc/systemd/system/foo.service` by running `systemctl edit foo.service`, add in the following line to `foo.servie` (this makes the service installable) ``` [Install] WantedBy=multi-user.target ``` 4. Enable the server: `systemd enable foo.service`
-
houtianze created this gist
Sep 21, 2016 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,11 @@ Let's say the `SysV Init Script` is called foo (the file `/etc/init.d/foo`): 1. Start the service through Systemd: `systemctl start foo` 2. systemd-sysv-generator will generate this file `/run/systemd/generator.late/foo.service`, copy this file to `/etc/systemd/system` by running: `cp /run/systemd/generator.late/foo.service /etc/systemd/system/foo.service` 3. Edit `/etc/systemd/system/foo.service` by running `systemctl edit foo.service`, add in the following line to `foo.servie` (this makes the service installable) ``` [Install] WantedBy=multi-user.target ``` 4. Enable the server: `systemd enable foo.service`