Skip to content

Instantly share code, notes, and snippets.

@Sllayan
Created September 9, 2024 13:46
Show Gist options
  • Select an option

  • Save Sllayan/0527e8dc73815def8b8a6b1884b400f5 to your computer and use it in GitHub Desktop.

Select an option

Save Sllayan/0527e8dc73815def8b8a6b1884b400f5 to your computer and use it in GitHub Desktop.

Revisions

  1. Sllayan revised this gist Sep 9, 2024. 1 changed file with 12 additions and 0 deletions.
    12 changes: 12 additions & 0 deletions SERVICE_NAME.service
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,12 @@
    [Unit]
    Description=orderlogsback
    After=network.target

    [Service]
    User=root
    Group=www-data
    WorkingDirectory=/var/www/orderlogsback
    ExecStart=/var/www/orderlogsback/.orderlogsback/bin/python3.10 /var/www/orderlogsback/server.py

    [Install]
    WantedBy=multi-user.target
  2. Sllayan created this gist Sep 9, 2024.
    27 changes: 27 additions & 0 deletions README.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,27 @@
    # Linux

    ## Run as a linux service in linux system

    ### How we can make a service in linux system

    You have to make a file in `/etc/systemd/system/` with `.service` format.

    format of content into this :

    ```python
    [Unit]
    Description={{description of your service}}
    After=network.target

    [Service]
    User=root
    Group=www-data
    WorkingDirectory={{directory of your service}}
    ExecStart={{the needed command to start }}

    [Install]
    WantedBy=multi-user.target

    ```

    You can also configure many things according to your needs.