richard.herbert
01/30/2023, 2:00 PMcommandbox-service-manager@ortus
module on macOS and get this...
❯ install commandbox-service-manager@ortus --verbose --force
√ | Installing package [forgebox:commandbox-service-manager@ortus]
|---------------------------------------------------------------------------
| Verifying package 'commandbox-service-manager@ortus' in forgebox, please wait...
| Installing version [1.4.2].
| Verified entry in forgebox: 'commandbox-service-manager@ortus'
| Package found in local artifacts!
| Decompressing...
| /Volumes/sites/_commandbox/cfml/box.json updated with dependency.
| Installing to: /Volumes/sites/_commandbox/cfml/modules/commandbox-service-manager@ortus
| -> 39 File(s) Installed
| -> 0 File(s) ignored
| Eureka, 'commandbox-service-manager@ortus' has been installed!
| Activating your new module for instant use...
|---------------------------------------------------------------------------
bash: syntax error near unexpected token `('
I now get that bash error for all commands in the Box terminal.bdw429s
01/30/2023, 8:03 PMbdw429s
01/30/2023, 8:03 PMbdw429s
01/30/2023, 8:04 PMbdw429s
01/30/2023, 8:04 PMbdw429s
01/30/2023, 8:04 PMbdw429s
01/30/2023, 8:05 PMrichard.herbert
01/30/2023, 8:14 PMTurn on debugging for the module to see what commands it's trying to runCan you remind me how I turn on module debugging? Interestingly I have the use of two Macs, this only happens on one of them. Everything else seems to work just fine.
bdw429s
01/30/2023, 8:16 PMbdw429s
01/30/2023, 8:17 PMbdw429s
01/30/2023, 8:17 PMconfig set modules.commandbox-service-manager@ortus.debug=true
richard.herbert
01/30/2023, 8:19 PMrichard.herbert
01/30/2023, 8:20 PMSet modules.commandbox-service-manager@ortus.debug = true
run sudo launchctl list | grep Default-(default.localhost) || ( exit 0 > /dev/null )
bash: syntax error near unexpected token `('
bdw429s
01/30/2023, 8:20 PMmodules.nameOfMOdule.nameOfSetting
bdw429s
01/30/2023, 8:20 PMconfig set modules._
and hit tab, you'll see your options to start filtering on.bdw429s
01/30/2023, 8:21 PM(default.localhost)
is the name of the CommandBox server or the name of the service.bdw429s
01/30/2023, 8:21 PMbdw429s
01/30/2023, 8:21 PMbdw429s
01/30/2023, 8:22 PMrichard.herbert
01/30/2023, 8:22 PM"Default (default.localhost)"
bdw429s
01/30/2023, 8:22 PMrichard.herbert
01/30/2023, 8:22 PMrichard.herbert
01/30/2023, 8:23 PMbdw429s
01/30/2023, 8:23 PMrichard.herbert
01/30/2023, 8:23 PMbdw429s
01/30/2023, 8:23 PMbdw429s
01/30/2023, 8:24 PMbdw429s
01/30/2023, 8:24 PMfunction getServiceFileName( required string serviceName ) {
return '/Library/LaunchDaemons/#serviceName#.plist';
}
bdw429s
01/30/2023, 8:25 PM/Library/LaunchDaemons/#Default-(default.localhost)#.plist
bdw429s
01/30/2023, 8:25 PMbdw429s
01/30/2023, 8:25 PMDefault (default.localhost)
showed up as Default-(default.localhost)
in the bash commandbdw429s
01/30/2023, 8:26 PMbdw429s
01/30/2023, 8:26 PMsite1
, lolbdw429s
01/30/2023, 8:27 PMbdw429s
01/30/2023, 8:27 PMrichard.herbert
01/30/2023, 8:27 PMrichard.herbert
01/30/2023, 8:29 PMWindows isn't quite as picky about its service names since it doesn't create files with them, just registry entriesYes, I also am using Service Manager on a Windows box, that's where I got my fancy service name habit from 🙂
richard.herbert
01/30/2023, 9:21 PM❯ server service create site1 --start
run sudo mv "/Volumes/sites/_commandbox/temp/FCF411A6-7DBB-4829-81F3EC127186339C.service" "/Library/LaunchDaemons/site1.plist"
run sudo chmod 755 /Library/LaunchDaemons/site1.plist
run sudo chown root /Library/LaunchDaemons/site1.plist
Service [site1] created!
Sending Service start control for [site1]
run sudo launchctl load /Library/LaunchDaemons/site1.plist
Service started!
run sudo launchctl list | grep rdh || ( exit 0 > /dev/null )
❯ server service stop site1
Sending Service stop control for [site1]
run sudo launchctl unload /Library/LaunchDaemons/site1.plist
Service stopped!
run sudo launchctl list | grep rdh || ( exit 0 > /dev/null )
❯ server service remove site1
run sudo launchctl list | grep site1 || ( exit 0 > /dev/null )
run sudo launchctl bootout system/site1
Boot-out failed: 3: No such process
ERROR (5.7.0+00653)
Error removing service file [/Library/LaunchDaemons/site1.plist]: Command returned failing exit code [3]
Please try as root. Error location: /Volumes/sites/_commandbox/cfml/system/BaseCommand.cfc:234
run sudo launchctl list | grep rdh || ( exit 0 > /dev/null )
That location seems to be the error handler, I'm not sure how to find where that sprang from.
I am running CB as root sudo box
bdw429s
01/30/2023, 9:28 PMsudo launchctl bootout rdh
sudo rm -f "path-to-service-file"
bdw429s
01/30/2023, 9:29 PMrun sudo launchctl bootout system/site1
Boot-out failed: 3: No such process
bdw429s
01/30/2023, 9:30 PMbdw429s
01/30/2023, 9:33 PMsudo launchctl bootout system /Library/LaunchDaemons/site1.plist
bdw429s
01/30/2023, 9:34 PMbdw429s
01/30/2023, 9:41 PMbdw429s
01/30/2023, 9:49 PMgrep
input. We only use grep
on MacOs as the Linux system.d has better supportrichard.herbert
01/30/2023, 10:01 PM❯ server service start site1
Sending Service start control for [site1]
Service started!
sudo launchctl list | grep site1
40578 0 site1
sudo launchctl bootout system /Library/LaunchDaemons/site1.plist
sudo launchctl list | grep site1
And that seems to be gone but going back the CB...
❯ server service status site1
Service name: site1
Service status: running
❯ server service stop site1
Sending Service stop control for [site1]
Service stopped!
❯ server service remove site1
ERROR (5.7.0+00653)
Error removing service file [/Library/LaunchDaemons/site1.plist]: Command returned failing exit code [3]
Please try as root. Error location: /Volumes/sites/_commandbox/cfml/system/BaseCommand.cfc:234
Bedtime here, I'll take another look tomorrow - thanks for your thoughts Bradbdw429s
01/30/2023, 10:23 PMbdw429s
01/30/2023, 10:24 PMsudo launchctl bootout system /Library/LaunchDaemons/site1.plist
does workbdw429s
01/30/2023, 10:38 PMrichard.herbert
02/01/2023, 5:53 PM❯ server cd "Default (default.localhost)"
> cd "/Volumes/sites/_default.localhost/webroot/"
/Volumes/sites/_default.localhost/webroot/bash: unexpected EOF while looking for matching `"'
bash: syntax error: unexpected end of file
❯ config set modules.commandbox-service-manager@ortus.debug=true
Set modules.commandbox-service-manager@ortus.debug = true
run sudo launchctl list | grep "rdh"" || ( exit 0 > /dev/null )
bash: unexpected EOF while looking for matching `"'
bash: syntax error: unexpected end of file
❯ server service remove rdh
run sudo launchctl list | grep "rdh"" || ( exit 0 > /dev/null )
bash: unexpected EOF while looking for matching `"'
bash: syntax error: unexpected end of file
ERROR (5.7.0+00653)
Command returned failing exit code [2]
run sudo launchctl list | grep "rdh"" || ( exit 0 > /dev/null )
bash: unexpected EOF while looking for matching `"'
bash: syntax error: unexpected end of file
sudo launchctl list | grep rdh
--- nothing returned ---
❯ pwd
/Volumes/sites/_default.localhost/webroot/
run sudo launchctl list | grep "rdh"" || ( exit 0 > /dev/null )
bash: unexpected EOF while looking for matching `"'
bash: syntax error: unexpected end of file
With server.json starting...
{
"name":"rdh",
"openBrowser":"false",
"web":{
"host":"localhost",
"http":{
"port":"8500"
},
❯ server start
√ | Starting Server
| √ | Setting Server Profile to [local]
| √ | Installing package [java:openjdk11_jre_x64_mac_hotspot_jdk-11.0.7+10:lockVersion]
| √ | Installing package [forgebox:lucee@5.3.7+48]
| √ | Loading CFConfig into server
run sudo launchctl list | grep "rdh"" || ( exit 0 > /dev/null )
bash: unexpected EOF while looking for matching `"'
bash: syntax error: unexpected end of file
❯ server list rdh
Processing (3) servers, please wait...
rdh (running)
<http://localhost:8500>
CF Engine: lucee 5.3.7+48
Webroot: /Volumes/sites/_default.localhost/webroot/
Last Started: 01-Feb-2023 17:49:10
run sudo launchctl list | grep "rdh"" || ( exit 0 > /dev/null )
bash: unexpected EOF while looking for matching `"'
bash: syntax error: unexpected end of file
❯ server service create
ERROR (5.7.0+00653)
Service [rdh] already exists. Please remove first or specify a different "servicename".
run sudo launchctl list | grep "rdh"" || ( exit 0 > /dev/null )
bash: unexpected EOF while looking for matching `"'
bash: syntax error: unexpected end of file
❯ server service remove rdh
run sudo launchctl list | grep "rdh"" || ( exit 0 > /dev/null )
bash: unexpected EOF while looking for matching `"'
bash: syntax error: unexpected end of file
ERROR (5.7.0+00653)
Command returned failing exit code [2]
run sudo launchctl list | grep "rdh"" || ( exit 0 > /dev/null )
bash: unexpected EOF while looking for matching `"'
bash: syntax error: unexpected end of file
A lot of stuff there but hopefully it might help?richard.herbert
02/01/2023, 5:56 PMrun sudo launchctl list | grep "rdh"" || ( exit 0 > /dev/null )
There's an extra quote "rdh""
?bdw429s
02/01/2023, 7:44 PMbdw429s
02/01/2023, 7:44 PMbdw429s
02/01/2023, 7:44 PMbdw429s
02/01/2023, 7:44 PMrichard.herbert
02/01/2023, 7:45 PMbdw429s
02/01/2023, 7:49 PMrichard.herbert
02/01/2023, 7:52 PMrichard.herbert
02/01/2023, 8:01 PMcommandbox-service-manager@ortus@^1.4.2 │ 1.4.4 │ 1.4.4 │ 1.4.4 │ /modules/commandbox-service-manager@ortus
bdw429s
02/01/2023, 8:36 PMbdw429s
02/01/2023, 8:36 PMrichard.herbert
02/01/2023, 8:40 PM❯ update commandbox-service-manager@ortus@1.4.5 --system
Resolving Dependencies, please wait...
ERROR (5.7.0+00653)
Package(s) [commandbox-service-manager@ortus@1.4.5] not found.
Use "outdated" to see what packages are available to update. Only pass the package name to this command.
richard.herbert
02/01/2023, 8:44 PM❯ install commandbox-service-manager@ortus@1.4.5
× | Installing package [forgebox:commandbox-service-manager@ortus@1.4.5]
|---------------------------------------------------------------------------
| Verifying package 'commandbox-service-manager@ortus' in forgebox, please wait...
|---------------------------------------------------------------------------
ERROR (5.7.0+00653)
Version [1.4.5] not found for package [commandbox-service-manager@ortus].
Available versions are [ 1.4.4, 1.4.3, 1.4.2, 1.4.1, 1.4.0, 1.4.0-alpha, 1.3.5, 1.3.4, 1.3.3, 1.3.2, 1.3.1, 1.3.0, 1.2.6, 1.2.5, 1.2.4, 1.2.3, 1.2.1, 1.2.0, 1.2.0-beta, 1.1.2-beta, 1.1.1-beta, 1.1.0-beta, 1.0.3, 1.0.2, 1.0.1, 1.0.0, 0.6.0, 0.5.0, 0.2.0]
bdw429s
02/01/2023, 8:56 PMbdw429s
02/01/2023, 8:57 PMrichard.herbert
02/01/2023, 8:57 PMbdw429s
02/01/2023, 8:57 PMbdw429s
02/01/2023, 8:58 PM❯ forgebox show commandbox-service-manager@ortus
Contacting ForgeBox, please wait...
CommandBox Service Manager ( Ortus Solutions, ortus ) Rating:
This module adds the ability for CommandBox to help you create and manage services for your servers.
...
Type: CommandBox Modules
Slug: "commandbox-service-manager@ortus"
Summary: A module to help manage services for CommandBox servers and more.
Versions: 1.4.5, 1.4.4, 1.4.3, 1.4.2, 1.4.1 ( 22 more...)
0.6.0
0.5.0
0.2.0
bdw429s
02/01/2023, 8:59 PMrichard.herbert
02/01/2023, 8:59 PMType: CommandBox Modules
Slug: "commandbox-service-manager@ortus"
Summary: A module to help manage services for CommandBox servers and more.
Versions: 1.4.4, 1.4.3, 1.4.2, 1.4.1, 1.4.0 ( 21 more...)
0.6.0
0.5.0
0.2.0
Created On: 11-Feb-19
Updated On: 12-Aug-22
ForgeBox Views: 247
Downloads: 0
Installs: 3,383
Home URL:
Source URL:
Bugs URL:
Documentation URL:
richard.herbert
02/01/2023, 8:59 PMbdw429s
02/01/2023, 8:59 PMbdw429s
02/01/2023, 9:00 PMbdw429s
02/01/2023, 9:01 PMrichard.herbert
02/01/2023, 9:01 PMbdw429s
02/01/2023, 9:02 PMrichard.herbert
02/01/2023, 9:03 PMforgebox show commandbox-service-manager@ortus
?
I did and posted the response - 1.4.4bdw429s
02/01/2023, 9:04 PMbdw429s
02/01/2023, 9:04 PMbdw429s
02/01/2023, 9:04 PMrichard.herbert
02/01/2023, 9:05 PMType: CommandBox Modules
Slug: "commandbox-service-manager@ortus"
Summary: A module to help manage services for CommandBox servers and more.
Versions: 1.4.5, 1.4.4, 1.4.3, 1.4.2, 1.4.1 ( 22 more...)
0.6.0
0.5.0
0.2.0
Created On: 11-Feb-19
Updated On: 12-Aug-22
ForgeBox Views: 252
Downloads: 0
Installs: 3,385
Home URL:
Source URL:
Bugs URL:
Documentation URL:
I'll try an update...richard.herbert
02/01/2023, 9:06 PMrichard.herbert
02/01/2023, 9:09 PM❯ server service status
bash: unexpected EOF while looking for matching `"'
bash: syntax error: unexpected end of file
ERROR (5.7.0+00653)
Command returned failing exit code [2]
bash: unexpected EOF while looking for matching `"'
bash: syntax error: unexpected end of file
❯ server service stop
Sending Service stop control for [rdh]
Service stopped!
bash: unexpected EOF while looking for matching `"'
bash: syntax error: unexpected end of file
❯ server service start
Sending Service start control for [rdh]
Service started!
bash: unexpected EOF while looking for matching `"'
bash: syntax error: unexpected end of file
bdw429s
02/01/2023, 9:10 PMbdw429s
02/01/2023, 9:10 PMrichard.herbert
02/01/2023, 9:11 PM❯ config set modules.commandbox-service-manager@ortus.debug=true
Set modules.commandbox-service-manager@ortus.debug = true
bash: unexpected EOF while looking for matching `"'
bash: syntax error: unexpected end of file
❯ server service status
bash: unexpected EOF while looking for matching `"'
bash: syntax error: unexpected end of file
ERROR (5.7.0+00653)
Command returned failing exit code [2]
bash: unexpected EOF while looking for matching `"'
bash: syntax error: unexpected end of file
❯ server service stop
Sending Service stop control for [rdh]
Service stopped!
bash: unexpected EOF while looking for matching `"'
bash: syntax error: unexpected end of file
bdw429s
02/01/2023, 9:12 PMbdw429s
02/01/2023, 9:13 PMbdw429s
02/01/2023, 9:13 PMconfig set debugNativeExecution=true
bdw429s
02/01/2023, 9:13 PMrun
command (which is what the service manger uses internally)bdw429s
02/01/2023, 9:14 PMbash: unexpected EOF while looking for matching "'
is referring to, we're just shooting in the darkrichard.herbert
02/01/2023, 9:14 PM❯ config set debugNativeExecution=true
Set debugNativeExecution = true
/bin/bash -i -c sudo launchctl list | grep "rdh"" || ( exit 0 > /dev/null ) 2>&1; ( exit $? > /dev/null )
bash: unexpected EOF while looking for matching `"'
bash: syntax error: unexpected end of file
Still that extra "
bdw429s
02/01/2023, 9:14 PMbdw429s
02/01/2023, 9:14 PMbdw429s
02/01/2023, 9:16 PMlist --system
show the latest version and have you tried restarting the CLI?richard.herbert
02/01/2023, 9:17 PM│ └── propertyFile (1.3.2)
├── commandbox-service-manager@ortus (1.4.5)
├─┬ commandbox-dotenv (2.3.0)
richard.herbert
02/01/2023, 9:17 PMbdw429s
02/01/2023, 9:18 PMmodules/MacServiceManager.cfc
inside the module should be
var rawStatus = trim( runNative( cmd='launchctl list | grep "#escapeRegex( ServiceName )#" || ( exit 0 > /dev/null )', forceReturn=true ) );
bdw429s
02/01/2023, 9:18 PM"#escapeRegex( ServiceName )#"
bdw429s
02/01/2023, 9:19 PMrichard.herbert
02/01/2023, 9:20 PM❯ server service status
run sudo launchctl list | grep "rdh" || ( exit 0 > /dev/null )
/bin/bash -i -c sudo launchctl list | grep "rdh" || ( exit 0 > /dev/null ) 2>&1; ( exit $? > /dev/null )
Service name: rdh
Service status: stopped
run sudo launchctl list | grep "rdh" || ( exit 0 > /dev/null )
/bin/bash -i -c sudo launchctl list | grep "rdh" || ( exit 0 > /dev/null ) 2>&1; ( exit $? > /dev/null )
❯ server service stop
Sending Service stop control for [rdh]
run sudo launchctl unload /Library/LaunchDaemons/rdh.plist
/bin/bash -i -c sudo launchctl unload /Library/LaunchDaemons/rdh.plist 2>&1; ( exit $? > /dev/null )
/Library/LaunchDaemons/rdh.plist: Could not find specified service
Unload failed: 113: Could not find specified service
Service stopped!
run sudo launchctl list | grep "rdh" || ( exit 0 > /dev/null )
/bin/bash -i -c sudo launchctl list | grep "rdh" || ( exit 0 > /dev/null ) 2>&1; ( exit $? > /dev/null )
❯ server service start
Sending Service start control for [rdh]
run sudo launchctl load /Library/LaunchDaemons/rdh.plist
/bin/bash -i -c sudo launchctl load /Library/LaunchDaemons/rdh.plist 2>&1; ( exit $? > /dev/null )
Service started!
run sudo launchctl list | grep "rdh" || ( exit 0 > /dev/null )
/bin/bash -i -c sudo launchctl list | grep "rdh" || ( exit 0 > /dev/null ) 2>&1; ( exit $? > /dev/null )
richard.herbert
02/01/2023, 9:22 PMrichard.herbert
02/02/2023, 8:20 PMremove
(I am running as root)
❯ config set debugNativeExecution=true
Set debugNativeExecution = true
/bin/bash -i -c sudo launchctl list | grep "rdh" || ( exit 0 > /dev/null ) 2>&1; ( exit $? > /dev/null )
❯ config set modules.commandbox-service-manager@ortus.debug=true
Set modules.commandbox-service-manager@ortus.debug = true
run sudo launchctl list | grep "rdh" || ( exit 0 > /dev/null )
/bin/bash -i -c sudo launchctl list | grep "rdh" || ( exit 0 > /dev/null ) 2>&1; ( exit $? > /dev/null )
❯ server service status
run sudo launchctl list | grep "rdh" || ( exit 0 > /dev/null )
/bin/bash -i -c sudo launchctl list | grep "rdh" || ( exit 0 > /dev/null ) 2>&1; ( exit $? > /dev/null )
Service name: rdh
Service status: stopped
run sudo launchctl list | grep "rdh" || ( exit 0 > /dev/null )
/bin/bash -i -c sudo launchctl list | grep "rdh" || ( exit 0 > /dev/null ) 2>&1; ( exit $? > /dev/null )
❯ server service start
Sending Service start control for [rdh]
run sudo launchctl load /Library/LaunchDaemons/rdh.plist
/bin/bash -i -c sudo launchctl load /Library/LaunchDaemons/rdh.plist 2>&1; ( exit $? > /dev/null )
Service started!
run sudo launchctl list | grep "rdh" || ( exit 0 > /dev/null )
/bin/bash -i -c sudo launchctl list | grep "rdh" || ( exit 0 > /dev/null ) 2>&1; ( exit $? > /dev/null )
❯ server service status
run sudo launchctl list | grep "rdh" || ( exit 0 > /dev/null )
/bin/bash -i -c sudo launchctl list | grep "rdh" || ( exit 0 > /dev/null ) 2>&1; ( exit $? > /dev/null )
Service name: rdh
Service status: running
run sudo launchctl list | grep "rdh" || ( exit 0 > /dev/null )
/bin/bash -i -c sudo launchctl list | grep "rdh" || ( exit 0 > /dev/null ) 2>&1; ( exit $? > /dev/null )
❯ server service stop
Sending Service stop control for [rdh]
run sudo launchctl unload /Library/LaunchDaemons/rdh.plist
/bin/bash -i -c sudo launchctl unload /Library/LaunchDaemons/rdh.plist 2>&1; ( exit $? > /dev/null )
Service stopped!
run sudo launchctl list | grep "rdh" || ( exit 0 > /dev/null )
/bin/bash -i -c sudo launchctl list | grep "rdh" || ( exit 0 > /dev/null ) 2>&1; ( exit $? > /dev/null )
❯ server service status
run sudo launchctl list | grep "rdh" || ( exit 0 > /dev/null )
/bin/bash -i -c sudo launchctl list | grep "rdh" || ( exit 0 > /dev/null ) 2>&1; ( exit $? > /dev/null )
Service name: rdh
Service status: stopped
run sudo launchctl list | grep "rdh" || ( exit 0 > /dev/null )
/bin/bash -i -c sudo launchctl list | grep "rdh" || ( exit 0 > /dev/null ) 2>&1; ( exit $? > /dev/null )
❯ server service remove rdh --force
run sudo launchctl list | grep "rdh" || ( exit 0 > /dev/null )
/bin/bash -i -c sudo launchctl list | grep "rdh" || ( exit 0 > /dev/null ) 2>&1; ( exit $? > /dev/null )
run sudo launchctl bootout system "/Library/LaunchDaemons/rdh.plist"
/bin/bash -i -c sudo launchctl bootout system "/Library/LaunchDaemons/rdh.plist" 2>&1; ( exit $? > /dev/null )
/Library/LaunchDaemons/rdh.plist: Could not find specified service
Boot-out failed: 113: Unknown error: 113
Could not find service.
ERROR (5.7.0+00653)
Error removing service file [/Library/LaunchDaemons/rdh.plist]: Command returned failing exit code [113]
Please try as root. Error location: /Volumes/sites/_commandbox/cfml/system/BaseCommand.cfc:234
run sudo launchctl list | grep "rdh" || ( exit 0 > /dev/null )
/bin/bash -i -c sudo launchctl list | grep "rdh" || ( exit 0 > /dev/null ) 2>&1; ( exit $? > /dev/null )