[V2] "pm2 startup" error when setting up autorestarting on Linux #1798

Closed
opened 2018-06-04 16:28:57 +02:00 by Kovaelin · 2 comments
Kovaelin commented 2018-06-04 16:28:57 +02:00 (Migrated from github.com)

Other bugs

What were you trying to do?

I was trying to setup autorestarting on Linux. I got up all the way up to pm2 startup before getting the final error message.

What were you expecting to happen?

I was expecting to get a command that I would need to issue before autorestarting would take effect.

What actually happened?

I was actually able to get pm2 running, however I am receiving this message when I try using pm2 startup

[PM2] Init System found: systemd
Platform systemd
Template
[Unit]
Description=PM2 process manager
Documentation=https://pm2.keymetrics.io/
After=network.target

[Service]
Type=forking
User=root
LimitNOFILE=infinity
LimitNPROC=infinity
LimitCORE=infinity
Environment=PATH=/root/.nvm/versions/node/v10.1.0/bin:/bin:/usr/local/sbin:/u
sr/local/bin:/usr/sbin:/usr/bin
Environment=PM2_HOME=/root/.pm2
PIDFile=/root/.pm2/pm2.pid

ExecStart=/root/.nvm/versions/node/v10.1.0/lib/node_modules/pm2/bin/pm2 resur
rect
ExecReload=/root/.nvm/versions/node/v10.1.0/lib/node_modules/pm2/bin/pm2 relo
ad all
ExecStop=/root/.nvm/versions/node/v10.1.0/lib/node_modules/pm2/bin/pm2 kill

[Install]
WantedBy=multi-user.target

Target path
/etc/systemd/system/pm2-root.service
Command list
[ 'systemctl enable pm2-root',
'systemctl start pm2-root',
'systemctl daemon-reload',
'systemctl status pm2-root' ]
[PM2] Writing init configuration in /etc/systemd/system/pm2-root.service
[PM2] Making script booting at startup...
[PM2] [-] Executing: systemctl enable pm2-root...
[PM2] [v] Command successfully executed.
[PM2] [-] Executing: systemctl start pm2-root...
Job for pm2-root.service failed because the service did not take the steps re
quired by its unit configuration.
See "systemctl status pm2-root.service" and "journalctl -xe" for details.
[ERROR] Exit code : 1
[PM2][ERROR] systemctl start pm2-root failed, see error above.

How can we reproduce this issue?

I am not sure, but I believe it may have something to do with me unsuccessfully trying to do the systemd steps on this page: https://twentysix26.github.io/Red-Docs/red_guide_linux_autostart/

Doing the systemd steps before doing the pm2 steps, instead of only doing the pm2 steps, might have caused conflicts with the ".service".

I do not know how to go back and delete the bad "red.service" that might have been created or what to do with "systemctl status pm2-root.service" and "journalctl -xe".

Any help would be appreciated. Thanks

# Other bugs <!-- Did you find a bug with something other than a command? Fill out the following: --> #### What were you trying to do? I was trying to setup autorestarting on Linux. I got up all the way up to `pm2 startup` before getting the final error message. #### What were you expecting to happen? I was expecting to get a command that I would need to issue before autorestarting would take effect. #### What actually happened? I was actually able to get pm2 running, however I am receiving this message when I try using `pm2 startup` > [PM2] Init System found: systemd Platform systemd Template [Unit] Description=PM2 process manager Documentation=https://pm2.keymetrics.io/ After=network.target > > [Service] Type=forking User=root LimitNOFILE=infinity LimitNPROC=infinity LimitCORE=infinity Environment=PATH=/root/.nvm/versions/node/v10.1.0/bin:/bin:/usr/local/sbin:/u sr/local/bin:/usr/sbin:/usr/bin Environment=PM2_HOME=/root/.pm2 PIDFile=/root/.pm2/pm2.pid > > ExecStart=/root/.nvm/versions/node/v10.1.0/lib/node_modules/pm2/bin/pm2 resur rect ExecReload=/root/.nvm/versions/node/v10.1.0/lib/node_modules/pm2/bin/pm2 relo ad all ExecStop=/root/.nvm/versions/node/v10.1.0/lib/node_modules/pm2/bin/pm2 kill > > [Install] WantedBy=multi-user.target > > Target path /etc/systemd/system/pm2-root.service Command list [ 'systemctl enable pm2-root', 'systemctl start pm2-root', 'systemctl daemon-reload', 'systemctl status pm2-root' ] [PM2] Writing init configuration in /etc/systemd/system/pm2-root.service [PM2] Making script booting at startup... [PM2] [-] Executing: systemctl enable pm2-root... [PM2] [v] Command successfully executed. [PM2] [-] Executing: systemctl start pm2-root... Job for pm2-root.service failed because the service did not take the steps re quired by its unit configuration. See "systemctl status pm2-root.service" and "journalctl -xe" for details. [ERROR] Exit code : 1 [PM2][ERROR] systemctl start pm2-root failed, see error above. #### How can we reproduce this issue? I am not sure, but I believe it may have something to do with me unsuccessfully trying to do the systemd steps on this page: https://twentysix26.github.io/Red-Docs/red_guide_linux_autostart/ Doing the systemd steps before doing the pm2 steps, instead of only doing the pm2 steps, might have caused conflicts with the ".service". I do not know how to go back and delete the bad "red.service" that might have been created or what to do with "systemctl status pm2-root.service" and "journalctl -xe". Any help would be appreciated. Thanks
Tobotimus commented 2018-08-13 08:52:47 +02:00 (Migrated from github.com)

Hi, sorry this took so long for a response. I'm unfortunately not an expert on the subject, but perhaps the helpful people in our Support Squad could give you a hand over in #support at https://discord.gg/red. Thanks!

Hi, sorry this took so long for a response. I'm unfortunately not an expert on the subject, but perhaps the helpful people in our Support Squad could give you a hand over in #support at https://discord.gg/red. Thanks!
Kovaelin commented 2018-08-14 03:18:02 +02:00 (Migrated from github.com)

I eventually decided to start over and skip over the systemd part, but I'm not sure how to fix it if somebody else comes across the problem.

I eventually decided to start over and skip over the systemd part, but I'm not sure how to fix it if somebody else comes across the problem.
Sign in to join this conversation.
No labels
Automated PR
Blocked
Blocked By: Damage Control
Blocked By: Dependency
Blocked By: Other PR
Breaking Change
Category: CI
Category: Cogs - Admin
Category: Cogs - Alias
Category: Cogs - Audio
Category: Cogs - Bank
Category: Cogs - Cleanup
Category: Cogs - CustomCommands
Category: Cogs - Dev
Category: Cogs - Downloader
Category: Cogs - Economy
Category: Cogs - Filter
Category: Cogs - General
Category: Cogs - Image
Category: Cogs - Mod
Category: Cogs - Modlog
Category: Cogs - Mutes
Category: Cogs - Permissions
Category: Cogs - Reports
Category: Cogs - Streams
Category: Cogs - Trivia
Category: Cogs - Trivia - Lists
Category: Cogs - Warnings
Category: Core - API - App Commands Package
Category: Core - API - Audio
Category: Core - API - Bank
Category: Core - API - Commands Package
Category: Core - API - Config
Category: Core - API - Other
Category: Core - API - Utils Package
Category: Core - Bot Class
Category: Core - Bot Commands
Category: Core - Command-line Interfaces
Category: Core - Downloader
Category: Core - Help
Category: Core - i18n
Category: Core - Modlog
Category: Core - Other Internals
Category: Core - RPC/ZMQ
Category: Docker
Category: Docs - Changelogs
Category: Docs - For Developers
Category: Docs - Install Guides
Category: Docs - Other
Category: Docs - User Guides
Category: Meta
Category: RPC/ZMQ methods
Category: Vendored Packages
Changelog Entry: Added
Changelog Entry: Pending
Changelog Entry: Skipped
Closed: Duplicate
Closed: External
Closed: Invalid
Closed: User Error
Closed: Won't Fix
Complex Issue
Docs-only
Feature Branch
Good First Issue
Help Wanted
High Priority
Needs Backport To stable-docs
No Activity
No Repro
QA: Bypassed
QA: Changes Requested
QA: Passed
Release Blocker
Status: Accepted
Status: Frozen
Status: In Progress
Status: Needs Discussion
Status: Needs Info
Status: Needs Triage
Status: PRs Welcome
Type: Bug
Type: Dependency Update
Type: Deprecation
Type: Enhancement
Type: Feature
Type: Informational
Type: Merge
Type: Optimisation
Type: Question
Type: Removal
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
Mrcoolgamer11/Red-DiscordBot#1798
No description provided.