The config has two port lines, and the service takes the last one. Which commands leave a single line is up to you.
A grep match proves that a line exists. It says nothing about a second line just like it. A config can set the same value twice, and the program picks one by its own rules — often the last. So before editing, find every line with the setting, and afterwards read the whole file.
Leave a single port
In ~/text-lab/web.conf the port is set twice, and the service takes the last value. Make a single port=9090 line set the port; leave the comment and mode=training alone. Keep the original file as web.conf.bak.
Goals · 0 of 2
- Keep the original in web.conf.bak not done yet
- Leave one port line, set to 9090 not done yet
You saved web.conf with a single port=9090 line. The service was started with the old file. Which conclusions hold?
Several options are correct.
-
Many programs read their config at startup: until the service restarts, it keeps the old value. The service itself shows which value it uses now.
-
The copy is a separate file, and editing the original does not change it.
cat web.conf.bakshows the original lines.
Saving changes the file on disk, while a running service usually picks up the new port only after a restart.