[Docs] Mac/Windows autostart docs #2726
No reviewers
Labels
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
No due date set.
Dependencies
No dependencies set
Reference
Mrcoolgamer11/Red-DiscordBot!2726
Loading…
Reference in a new issue
No description provided.
Delete branch "V3/docs/mac_win_autostart"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Type
Description of the changes
Adds in Mac/Windows autostart docs. Gonna need to have someone actually test the instructions in the mac ones though seeing as I don't have a mac and came up with that plist based on reading docs
Ok, NSSM docs have been added, though so far it only covers installing NSSM via Chocolatey and then the actual setup of the service. Service setup is written to be done in Powershell, not cmd (there's four spots that use syntax for Powershell, three of them I know for sure how to get the same behavior in cmd, the fourth (which involves using the output of one command as an argument in another) I'm not sure on replicating in cmd)
@ -0,0 +50,4 @@.. code-block:: nonenssm install redbot $(Get-Command redbot).Definition <instance name> --no-promptFor this to work correctly with venv install, we should tell the user to activate venv before running this command.
Just spotted a few errors 😄
@ -0,0 +1,105 @@.. windows service guidemissing full stop
When

sphiux-buildis run, this doesn't format correctly:For reference here's my
.htmlfile:#2726 html files.zip
@ -0,0 +62,4 @@nssm set redbot AppStopMethodConsole 10000nssm set redbot AppRestartDelay 15000nssm set redbot AppStdout $Env:USERPROFILE\red-stdout.lognssm set redbot AppStderr $Env:USERPROFILE\red-stderr.logI think it would be better to use one log file for both stdout and stderr (nssm support that), it's easier to read like this.
@ -0,0 +24,4 @@Manually installing NSSM------------------------Go to `<https://nssm.cc/download>`_ and download the latest release. Once the downloadIt might be good to point at latest pre release (or at least pre-release build 2.2.4-101) as otherwise users may have problems with starting service on Windows 10 1703+. Technically we avoid this issue with
AppNoConsole=1but choco already installs that build anyway and this build also comes with handynssm dumpcommand that may help make certain things easier for Support Squad.Update: From only 2 support cases, I already found
nssm dumpvery valuable debug command that allows me to help people with nssm.@ -0,0 +81,4 @@.. code-block:: nonenssm set redbot ObjectName $Env:COMPUTERNAME\$Env:USERNAME <password>I personally wouldn't want to put my password in cmd/powershell as part of a command (one of the reason being it saving in command history), I think there should at least be mentioned an alternative way to set that password through
services.msc.Another issue user may run into is having no password on the account - he won't be able to run service on an account with a blank password as it could be considered a security issue, see: https://stackoverflow.com/a/1048691
While we probably shouldn't provide solution for it, it might be worth mentioning in the document.
One more thing about log files - I want to mention that there's also an option in nssm to rotate log files which might be worth enabling to avoid getting one very big log file, but I'm leaving that to reviewer of this PR.
I haven't looked closely at file rotation settings, so I'm not sure if there's an option to set max amount of those files before the old ones get removed.
@ -0,0 +81,4 @@.. code-block:: nonenssm set redbot ObjectName $Env:COMPUTERNAME\$Env:USERNAME <password>A follow up on this, both powershell and cmd have certain characters that have to be escaped, currently provided solution assumes that user's password won't contain such characters. I think that a better solution here would be using something that will prompt for password, e.g:
nssm set redbot ObjectName $Env:COMPUTERNAME\$Env:USERNAME $(Read-Host "Password")This one would still keep the password visible (as
input("Password: ")does in Python), but it would at least always get the password right.There is an option to replace password characters with asterixes in
Read-Hostby using-AsSecureStringbut it would result in this awfully wrong command (or at least I couldn't find a way to make this shorter in powershell):nssm set redbot ObjectName $Env:COMPUTERNAME\$Env:USERNAME $([System.Net.NetworkCredential]::new("", $(Read-Host -AsSecureString "Password")).Password)@ -0,0 +81,4 @@.. code-block:: nonenssm set redbot ObjectName $Env:COMPUTERNAME\$Env:USERNAME <password>yeah, probably gonna take some testing on this one
This is being deferred until further work with making this user-friendly.
We should also update this to use
python -O -m redbotinstead of justredbot(to go in line with the rest of the docs)If we have any other Mac users willing to test the plist file I would appreciate feedback as well. When I used it back when originally testing this, I recieved Error 2's while trying to have it autostart (usually representative of "file not found", but could also be something else, even though I pointed it at the correct redbot executable). The only other testing I have seen related to this in the Red server was a user in support at https://discord.com/channels/133049272517001216/387398816317440000/668614855397212170 who recieved a permissions error while trying to run the sudo command - not sure if it was a password issue or a true perms issue. Iirc I didn't run into permissions trouble when I tried this in Dec 19 and again in Februrary but it's something to be aware of.
Superseded by #4081 and #4082 (splitting the OSes up)
Pull request closed