doc: linux service instructions
Massimo Melina committed
Apr 17, 2023 at 10:06 UTC
ddc849eb53be6b0ee1245b1b3bba53b4ca962253
1 file changed
+33
-9
README.md
+33
-9
@@ -61,7 +61,7 @@ If you don't like this behavior, disable it in the Admin-panel or enter this con
61
62
### Other systems
63
64
-If your system is not Windows/Linux/Mac, you can try this alternative version:
64
+If your system is not Windows/Linux/Mac or you just don't want to run the binaries, you can try this alternative version:
65
66
1. [install node.js](https://nodejs.org)
67
2. execute at command line `npx hfs@latest`
@@ -72,14 +72,38 @@ Configuration and other files will be stored in `%HOME%/.vfs`
72
73
### Service
74
75
-If you want to run HFS as a service
76
-- if you installed with `npm` on Windows
77
- - service installation
78
- - run `npx qckwinsvc2 install name="HFS" description="HFS" path="%APPDATA%\npm\node_modules\hfs\src\index.js" args="--cwd %HOMEPATH%\.hfs" now`
79
- - service update
80
- - run `npx qckwinsvc2 uninstall name="HFS"`
81
- - run `npm -g update hfs`
82
- - run the service installation again
75
+If you want to run HFS at boot (as a service), we suggest the following methods
76
+
77
+#### On Linux
78
+1. [install node.js](https://nodejs.org)
79
+2. create a file `/etc/systemd/system/hfs.service` with this content
80
+ ```
81
+ [Unit]
82
+ Description=HFS
83
+ After=network.target
84
+
85
+ [Service]
86
+ Type=simple
87
+ Restart=always
88
+ ExecStart=/usr/bin/npx -y hfs@latest
89
+
90
+ [Install]
91
+ WantedBy=multi-user.target
92
+ ```
93
+3. run `sudo systemctl daemon-reload && sudo systemctl enable hfs && sudo systemctl start hfs && sudo systemctl status hfs`
94
+
95
+NB: update will be attempted at each restart
96
+
97
+#### On Windows
98
+
99
+1. [install node.js](https://nodejs.org)
100
+2. run `npm -g i hfs`
101
+3. run `npx qckwinsvc2 install name="HFS" description="HFS" path="%APPDATA%\npm\node_modules\hfs\src\index.js" args="--cwd %HOMEPATH%\.hfs" now`
102
+
103
+To update
104
+- run `npx qckwinsvc2 uninstall name="HFS"`
105
+- run `npm -g update hfs`
106
+- run `npx qckwinsvc2 install name="HFS" description="HFS" path="%APPDATA%\npm\node_modules\hfs\src\index.js" args="--cwd %HOMEPATH%\.hfs" now`
107
108
## Internationalization
109