Mac autostart docs #4082
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 project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
Mrcoolgamer11/Red-DiscordBot!4082
Loading…
Reference in a new issue
No description provided.
Delete branch "V3/docs/mac_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
Supersedes #2726
This one definitely needs testing by someone with a Mac as I do not have a Mac
I tested this a few days ago and wanted to note that I couldn't get it to work. Maybe I was just doing it wrong but even at that point I think the docs need to be tweaked a little bit because they're a little confusing and I wouldn't expect the end user to be able to figure this out.
I also wanted to point out that the PM2 guide for Linux does work completely on Mac, with no changes needed. That does require node & npm to be installed though, so I still think these docs are a good idea but still need some work.
Hi there, I finally was successful in using a plist to start Red on a Catalina machine (10.15.7). I ran into plenty of fun while trying to diagnose this and the other previous PR for Mac autostarting as plist file errors are not very easy to debug.
:xUserNamebe the same asGroupNameas the username did not exist as a group name. If theGroupNamekey is removed it will be set to the default group of the user which is much more ideal than us trying to guess the group the user belongs to.UserNamecannot access, the plist file will fail silently/show error 78.Replace:
/path/to/redbotwith your redbot executable pathinstance-namewith your instance nameusernamewith your Mac user nameHonestly don't know that I'm a fan of having the user edit the plist file with
vitbh. It tends to be a little complicated for anyone unfamiliar with it. What happens if we doEDITOR=/Applications/TextEdit.app/Contents/MacOS/TextEdit sudo -e /Library/LaunchDaemons/red.plist? I'm thinking if we can have the user edit with a GUI app that they may be a little more familiar with, it may simplify the editing part.I'll get this one fixed
Good call, it'll help with support to have the logs
Fair point
I had some halfway success by using these instructions:
This does attempt to open the file in TextEdit, and launches the program, but then it said

After hitting OK and closing the TextEdit process, the terminal window where the original commands were run is "hung" in the idea that it requires a ctrl-c to get back to the command prompt.
This guide should be running Red with
python -O -m redbotrather thanredbotexecutable directly - same as the systemd guide for Linux.As for the
sudo -e, I think Mac hasnanotoo (which we should have been doing in systemd guide for long time tbh), so we could just use that, assuming it actually works on Mac ofc.sudo nanoworks fine on Mac for this situation instead ofsudo -e. I also setpythonto be the bot's venv's python as Jack suggested with<string>/Users/mac_username/venv_name/bin/python -O -m /Users/mac_username/venv_name/bin/redbot</string>and that worked out ok as well.idk if this is worthy to add, but while I was testing it I changed
<string>--no-prompt</string>to
<string>--no-prompt --team-members-are-owners</string>assuming I could add additional flags, but that did not work (the bot didn't start) and I needed to change it to
<string>--no-prompt</string><string>--team-members-are-owners</string>Ja takk
tir. 2. mar. 2021, 21:37 skrev aikaterna notifications@github.com:
Got it, will switch it to
sudo nanoasnanois way easier to work with thanviif the user is unfamiliarI'll make sure there's a note in about this.
Ok, all requested changes have been made. Would someone just confirm that running
[p]restartfor the bot works? Not sure anyone's tested that specifically. Also may want to confirm thatwhich pythonwith the venv activated does indeed get the venv's python and not something elseI can confirm that
[p]restartdoes work, andwhich pythonreturned/Users/<my_user>/redenv/bin/pythonfor me (which worked)One thing that might be worthy to add is how to view the logs, maybe
nano /tmp/red_out.log?Ooh, good suggestion! Will get that added at some point
On Sat, Mar 6, 2021, 07:55 aleclol notifications@github.com wrote:
Added a note about the logging
One thing I thought of while testing this again was about the eventual size of the log files because information would be appended to the end of each log in /tmp every time the bot is restarted. I found some information that was rather old (10.6.x) that claims that /tmp is emptied every 3 days but I'm not finding much for Catalina regarding this. This is the only concern I have left before approving this item and am willing to approve it anyway, but we may get people with very large log files if there is no automatic cleaning of /tmp in Catalina.
Thanks to a link Palm provided I was able to find some info on, and confirm, that Catalina (10.15.x) should delete those files every 3 days or so. I would expect Big Sur does the same.