Wikipedia:Reference desk/Archives/Computing/2022 May 4
Computing desk | ||
---|---|---|
< May 3 | << Apr | May | Jun >> | May 5 > |
Welcome to the Wikipedia Computing Reference Desk Archives |
---|
The page you are currently viewing is a transcluded archive page. While you can leave answers for any questions shown below, please ask new questions on one of the current reference desk pages. |
May 4
editTrouble installing Linux service (systemd)
editSystemd is so confusing. I created a file /etc/systemd/system/multi-user.target.wants/my.service with the following contents:
[Unit]
Description=My Service
Wants=network.target
After=syslog.target network-online.target
[Service]
Type=simple
ExecStart=/home/bin/my
Restart=on-failure
RestartSec=10
KillMode=process
[Install]
WantedBy=multi-user.target
Then rebooted the system but the binary /home/bin/my never loads. What am I doing wrong here? Come to think of it, is there an easier way than this whole manual config files route of setting things up? Earl of Arundel (talk) 06:51, 4 May 2022 (UTC)
- systemd is a pain. Did you enable the service with the systemctl command? This article may help (it did when I created my own service) https://www.digitalocean.com/community/tutorials/how-to-use-systemctl-to-manage-systemd-services-and-units TrogWoolley (talk) 10:42, 4 May 2022 (UTC)
- Thanks! It wasn't so hard after all. Copying the service file directly to the /etc/systemd/system directory, then starting the service via systemctl seemed to fix the issue. Earl of Arundel (talk) 17:39, 4 May 2022 (UTC)
- systemd is a pain. Did you enable the service with the systemctl command? This article may help (it did when I created my own service) https://www.digitalocean.com/community/tutorials/how-to-use-systemctl-to-manage-systemd-services-and-units TrogWoolley (talk) 10:42, 4 May 2022 (UTC)
Percent sign in link
editThe link gets messed up because of an invalid character. Where do I find a list of what I can replace invalid characters with?
The URLwikilink contains "{Bende egitilmek istiyorum}78.180.7.191 (talk)"— Vchimpanzee • talk • contributions • 19:32, 4 May 2022 (UTC)
- Here's a URL encoding converter and reference. It's utf-8. { is %7B and } is %7D. Card Zero (talk) 03:34, 5 May 2022 (UTC)
- The characters "{" and "}" in a URL are unproblematic; the link https://en.wiki.x.io/w/index.php?title=Wikipedia:Teahouse&oldid=1060980341#{Bende_egitilmek_istiyorum}78.180.7.191_(talk) works just fine. How does the percent sign enter the picture? If you need to have a percent sign in the URL, for example to say "%20 indirim" (Turkish for "20% off"), you have to use "%2520 indirim", or else "%20" will be replaced by the space character. --Lambiam 07:24, 5 May 2022 (UTC)
- It's not working in a piped link, actually. Can anyone fix this?— Vchimpanzee • talk • contributions • 16:05, 5 May 2022 (UTC)
- Okay, the percent encoding worked in a piped link. Thanks.— Vchimpanzee • talk • contributions • 16:47, 5 May 2022 (UTC)
- Cool. By the way, I looked at the source of that talk page message, and it uses a template (?) called urlencode which can be used to produce codes like %7B by writing {{urlencode:{}}. This may be harder to use than just looking up the percent encoding, but it's good to know about. (It would go wrong with the closing curly bracket, unless there was something after it!) Card Zero (talk) 17:12, 5 May 2022 (UTC)
{{urlencode:}}
is called a parser function. It's part of MediaWiki, documented at mw:Help:Magic words#URL data. PrimeHunter (talk) 01:47, 6 May 2022 (UTC)
- The problem was an issue of wikilink syntax (see Help:Link § Disallowed characters), not of URL syntax. --Lambiam 21:27, 5 May 2022 (UTC)
- Cool. By the way, I looked at the source of that talk page message, and it uses a template (?) called urlencode which can be used to produce codes like %7B by writing {{urlencode:{}}. This may be harder to use than just looking up the percent encoding, but it's good to know about. (It would go wrong with the closing curly bracket, unless there was something after it!) Card Zero (talk) 17:12, 5 May 2022 (UTC)
- Okay, the percent encoding worked in a piped link. Thanks.— Vchimpanzee • talk • contributions • 16:47, 5 May 2022 (UTC)
- It's not working in a piped link, actually. Can anyone fix this?— Vchimpanzee • talk • contributions • 16:05, 5 May 2022 (UTC)