Scoop
Scoop copied to clipboard
[WIP] scoop services (first draft)
First draft PR for #1526
Services XML files will be located in ./bucket/services
for the main bucket and ~/scoop/buckets/<bucketname>/services
for other buckets.
Steps for testing
Checkout this PR and install sudo
, winsw
and php
.
λ scoop install sudo winsw
λ scoop install php
λ scoop services install php
Installing a service will look for a suitable XML file in the services
directory.
In this case, the service
property of php
is set to php-fpm
.
It will copy <bucket>/services/php-fpm.xml
to ~/scoop/persist/php/service/php-service.xml
and create a copy of WinSW.exe
at the same location (php-service.exe
)
Start/stop/restart the php service with:
λ scoop services start php
λ scoop services stop php
λ scoop services restart php
Uninstall the php service with (php-service.xml
and php-service.exe
will remain untouched)
λ scoop services uninstall php
Lists all services that are available and their status (only show installed apps)
λ scoop services list
[C]onfigured
| [I]nstalled
| | [S]atus
| | |
[-][-][-] caddy (caddy)
[+][+][+] php (php-fpm)
All commands can be run with sudo
.
Todo list:
- [ ] show information after installing an app with a service
- [ ] uninstall service before uninstalling an app
- [ ] implement/test
--all
option - [ ] implement/test
--global
option - [ ] adjust
schema.json
- [ ] things I overlooked or haven't thought about jet ...
Services todo list:
- [ ] apache
- [x] caddy
- [ ] minio
- [ ] mongodb
- [ ] nginx
- [x] php
- [x] php-nts
- [ ] rethinkdb
@deevus thought about doing that at first. If you take a look at the sample-allOptions.xml you'll see that WinSW has many options and I believe it's unnecessary to reimplement them just for a service running with the least amount of configuration. If need the user can change all options afterward.
Sorry, I just got back from holiday. This is looking promising.
I share @deevus's sentiment that it would be very nice to do it in JSON and generate XML.
Nice because Scoop could act as a simpler wrapper around WinSW, making it easier for manifest authors to do what's needed most of the time, like executable, arguments, and environment. It would also be nice to generate defaults for the service id, name, description, logging and restart without having to put them in the manifest.
I get your points about WinSW supporting lots of options, and allowing users to change options later. Wouldn't it be possible to keep both these benefits if we generate the XML?
This is a nice improvement I find myself needing in scoop to ship many of the developer tools I work on. Is there someone working actively on it? :smile:
I just scoop install mysql
'ed, but I'm not sure how to do service management. Apparently it's not yet possible with Scoop?
Hope this gets implemented soon - such a useful feature