Wikipedia:Reference desk/Archives/Computing/2022 May 4

= May 4 =

Trouble installing Linux service (systemd)
Systemd 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)

Percent sign in link
The link gets messed up because of an invalid character. Where do I find a list of what I can replace invalid characters with?

The URL wikilink 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.wikipedia.org/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 {{urlencode:{}} by writing &#123;{urlencode:{}&#125;. 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)
 * is called a parser function. It's part of MediaWiki, documented at mw:Help:Magic words. PrimeHunter (talk) 01:47, 6 May 2022 (UTC)
 * The problem was an issue of wikilink syntax (see ), not of URL syntax. --Lambiam 21:27, 5 May 2022 (UTC)