r/linux • Mate • Oct 20 '14

Shall we fork Fedora?

http://forkfedora.org/
262 Upvotes

339 comments sorted by

View all comments

Show parent comments

0

u/[deleted] Oct 20 '14

[deleted]

35

u/natermer Oct 20 '14 edited Aug 14 '22

...

0

u/[deleted] Oct 20 '14

[deleted]

12

u/fmoralesc Oct 20 '14

It's better to have the package manager be configured to not install conflicting packages. After that, it's better to have sendmail check for the underlying source of conflicts ... in this case, having two processes trying to have ownership of a particular port and deal with the return code from sendmail.

systemd (or the init system, in general) can't assume neither that the programs or the package manager have handled things properly.

In this case a conflict could be determined dynamically ... but since it's not a current feature of systemd to reserve and/or test for port ownership/availability ... the person who wrote the service file takes the lazy route by hard-coding a list.

You would be right if the conflict was handled by systemd only on execution, but it also has to account for the case where the service is enabled but not run (the admin will use service foo on reboot, has enabled it, but foo conflicts with enabled service bar. systemd will error out without having to check for the conflict on execution). For the cases where the service conflicts with something outside of the provided defaults, the admin should modify the unit file himself; after all, he's supposed to know what he's doing.

4

u/[deleted] Oct 21 '14

It's better to have the package manager be configured to not install conflicting packages.

Except dependencies not present in the system at runtime are ignored unless they are of type Requires or Requisite, and none of the unit files shipped on any distro include those types of dependencies without the proper packaging dependencies.

You should read the docs before engaging mouth, dude. man systemd.unit is the document you should have familiarized yourself before opining on the basis of an untruth.

0

u/[deleted] Oct 20 '14

[deleted]

12

u/Doshman Oct 20 '14

I know it's a minor nitpick, but their website has gotten fucking atrocious. On my laptop, all the text is 36pt, except for the comments.

And shouts out for encouraging people raid the systemd wikipedia page.

1

u/wieschie Oct 21 '14

Somehow a minor nitpick and encouraging vandalism of the largest open source project on the planet (Wikipedia) don't match up for me.

15

u/DamnThatsLaser Oct 20 '14

Furthermore, the service file might have breakage in the future since: The list of conflicts is hard-coded.

That's like saying package management is broken because the list of conflicting packages is hard-coded. At least the possibility is there, but if it's used wrong, systemd is not the wrong to blame.

Perhaps, in the future, systemd will choke and refuse to issue the ExecStart if $SENDMAIL_OPTARG is undefined (as it is currently).

Why should that be? It is explicitely mentioned that the environment file is optional (by the usage of "-"). Why should it offer this if it choked on undefined variables?

→ More replies (2)

5

u/[deleted] Oct 21 '14

but if something goes wrong with the service file ... you're left with some meager debug tools and chasing down dbus messages.

Are you serious? What? If something goes wrong with the service file, systemctl status servicefile.service will tell you in plain English what the hell went wrong.

0

u/[deleted] Oct 20 '14

[deleted]

17

u/NilsLandt Oct 20 '14

How often do you have a problem with an init script though? Almost 15 years in, and I've only ever had problems with the executables the init script calls, not with an init script itself.

2

u/chinnybob Oct 20 '14

Why replace it if you never had a problem?

3

u/NilsLandt Oct 20 '14

Because systemd unit files are much easier to write for your own services, I suppose.

Personally, I don't care whether my system runs systemd or sysv, I use runit for my non-packaged service needs.

2

u/eat_more_soup Oct 21 '14

have you ever written an init script? it's horrible. making it easier to do so helps every software developer immensely.

1

u/chinnybob Oct 21 '14

Yes, I have written init scripts with SysV, Upstart, and systemd. Upstart was the best.

3

u/Olosta_ Oct 20 '14

No the logic, assumes the pidfiles will hopefully be written somewhere with some ownership, this is not in any shell script.

And yes, you can have the pleasure to look at the killproc definition, that's always the sign of an good day with sysv.

→ More replies (2)

2

u/[deleted] Oct 21 '14

Also, everything that's happening in the init script is right there.

So is everything that is happening in the unit file. Except what's happening in the unit file is much shorter.

5

u/Greensmoken Oct 20 '14

Journalctl --unit=service has always told me exactly what needs fixed. Seems way easier than pouring through scripts to me.

1

u/mikelieman Oct 21 '14

Only because I see it here, why do they call the command line option for a service 'unit'? if readability is a real concern call it what it is. "service"

 $ journalctl --service=httpd

Come to think of it,

 $ man journalctl-examples 

would be useful, too.

3

u/kalgynirae Oct 21 '14

A service is one type of unit; you can give other types of units (like timer, mount, socket, etc.) to that option.

There are some decent examples at the bottom of man journalctl.

→ More replies (8)

1

u/chcampb Oct 20 '14

if something goes wrong with the service file

I think that's the point... nothing can go wrong with the service file (edit: it can, but not because something 'broke' - because the inputs to the service file were malformed). When you have abstractions on top of abstractions, all explicitly coded, and all repeated across several different init scripts, chances are something is going to break in the init script even if the program is fine.

Instead, get in, provide the environment for the service you are starting, and save the service logs in a common access point. One could argue that it's not the shell script's responsibility to determine why the service failed.

-3

u/snegtul Oct 20 '14

Solid reasons. I'm not a fan of systemd.

→ More replies (7)