Skip to content

Create web.service - #8

Open
fzahir786 wants to merge 2 commits into
developfrom
topic/NOJIRA-2222
Open

Create web.service#8
fzahir786 wants to merge 2 commits into
developfrom
topic/NOJIRA-2222

Conversation

@fzahir786

Copy link
Copy Markdown
Owner

No description provided.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a new systemd unit to run the webapp process as a service with a dependency on database.service.

Changes:

  • Introduces systemd/system/web.service with a Type=notify service definition.
  • Adds a database dependency via Requires=database.service.
  • Defines the ExecStart command for launching the web application.


[Service]
Type=notify
ExecStart=/usr/bin/webapp --db-connect localhost:5432

Copilot AI Feb 19, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TimeoutStartSec and TimeoutStopSec are not set. Relying on systemd defaults can hang boot/shutdown for a long time if the service gets stuck starting or stopping; please specify explicit timeouts per the repo guidance.

Refer: https://github.com/fzahir786/thunder-startup-services/edit/develop/.github/copilot-instructions.md#8-set-timeouts-and-limits-appropriately

Suggested change
ExecStart=/usr/bin/webapp --db-connect localhost:5432
ExecStart=/usr/bin/webapp --db-connect localhost:5432
TimeoutStartSec=30
TimeoutStopSec=10

Copilot uses AI. Check for mistakes.

[Service]
Type=notify
ExecStart=/usr/bin/webapp --db-connect localhost:5432

Copilot AI Feb 19, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For a long-running Type=notify service, consider adding an ExecReload= command so configuration can be reloaded without a full restart (where supported by the process).

Refer: https://github.com/fzahir786/thunder-startup-services/edit/develop/.github/copilot-instructions.md#5-configure-reloads

Suggested change
ExecStart=/usr/bin/webapp --db-connect localhost:5432
ExecStart=/usr/bin/webapp --db-connect localhost:5432
ExecReload=/bin/kill -HUP $MAINPID

Copilot uses AI. Check for mistakes.
@@ -0,0 +1,7 @@
[Unit]
Description=Web Application Service
Requires=database.service

Copilot AI Feb 19, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Requires=database.service pulls in the dependency but does not guarantee ordering. Add After=database.service so web.service won’t attempt DB connections before database.service has started.

Suggested change
Requires=database.service
Requires=database.service
After=database.service

Copilot uses AI. Check for mistakes.

[Service]
Type=notify
ExecStart=/usr/bin/webapp --db-connect localhost:5432

Copilot AI Feb 19, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The unit is missing an [Install] section (e.g., WantedBy=multi-user.target). Without it, systemctl enable web.service won’t create target symlinks and the service may not auto-start at boot unless something else pulls it in.

Refer: https://github.com/fzahir786/thunder-startup-services/edit/develop/.github/copilot-instructions.md#9-boot-integration-requirement

Suggested change
ExecStart=/usr/bin/webapp --db-connect localhost:5432
ExecStart=/usr/bin/webapp --db-connect localhost:5432
[Install]
WantedBy=multi-user.target

Copilot uses AI. Check for mistakes.
Description=Web Application Service
Requires=database.service

[Service]

Copilot AI Feb 19, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This systemd unit defines a [Service] without a User= directive, so the web application will run as root by default. Any remote code execution or configuration flaw in webapp would immediately yield full system compromise instead of being contained to an unprivileged account. Configure a dedicated non-privileged service user here and ensure the unit runs under that account.

Suggested change
[Service]
[Service]
User=webapp

Copilot uses AI. Check for mistakes.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated no new comments.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated 1 comment.

@@ -0,0 +1,7 @@
[Unit]
Description=Web Application Service

Copilot AI Feb 19, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Description is quite generic; please make it more specific to what this web service actually provides (e.g., product/component name and responsibility).

Refer: https://github.com/fzahir786/thunder-startup-services/blob/develop/.github/copilot-instructions.md#1-add-proper-service-description

Suggested change
Description=Web Application Service
Description=webapp HTTP front-end service providing the application's web API backed by the database

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants