Bug 273306 - sysutils/bacula*-server: pkg-install.server.in and pkg-deinstall.server.in are not used
Summary: sysutils/bacula*-server: pkg-install.server.in and pkg-deinstall.server.in ar...
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Some People
Assignee: Dan Langille
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-08-23 08:44 UTC by Lars Herschke
Modified: 2023-09-10 15:41 UTC (History)
1 user (show)

See Also:
lhersch: maintainer-feedback? (dvl)


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Lars Herschke 2023-08-23 08:44:09 UTC
The two files pkg-install.server.in and pkg-deinstall.server.in under files in bacula9-server, bacula11-server and bacula13-server are currently not used or needed.

In revision 360663, the two files were deleted and their references were also removed from the Makefile. In revision 364313 they were added again, but not in the Makefile. Since then, the two files are actually not referenced. So either you delete them again or you reference them again in the Makefile. In FreeBSD 13.2, at least the change in /etc/services is no longer needed, as the entries are now always there.
Comment 1 Dan Langille freebsd_committer freebsd_triage 2023-08-23 13:05:20 UTC
First thoughts:

We can remove pkg-install.client.in because all it does is /etc/services:

https://cgit.freebsd.org/ports/tree/sysutils/bacula9-server/files/pkg-install.client.in

It would remove a Makefile change to remove the reference.

We can also modify files/pkg-deinstall.client.in to remove lines 16-21

https://cgit.freebsd.org/ports/tree/sysutils/bacula9-server/files/pkg-deinstall.client.in?id=287a7ddd9b6935b8eb93775b6940eb8060e2ea31


Removing the `deinstall` files will also remove the messages about removing directories and users

e.g. lines 22+ at

* https://cgit.freebsd.org/ports/tree/sysutils/bacula9-server/files/pkg-deinstall.server.in?id=287a7ddd9b6935b8eb93775b6940eb8060e2ea31
* https://cgit.freebsd.org/ports/tree/sysutils/bacula9-server/files/pkg-deinstall.client.in?id=287a7ddd9b6935b8eb93775b6940eb8060e2ea31
Comment 2 Dan Langille freebsd_committer freebsd_triage 2023-08-23 13:19:03 UTC
If /etc/services < 13.2 does not contain the Bacula services perhaps we have to retain that message.
Comment 3 Lars Herschke 2023-08-23 13:23:30 UTC
In the PR, I was mainly concerned with the *.server.in scripts, since they are kind of hanging in the air at the moment. The information about the /etc/services should only help in the decision-making process.
Comment 4 Dan Langille freebsd_committer freebsd_triage 2023-09-10 14:29:42 UTC
NOTE: this was unintenionally committed via a8cc45bb7a5f1b8f4b7faa8506bb5ce65baa555b and reverted through 7f03f5c795dd7226e8f1dceb5198ce3873cf8dfa

Now I'm working on it again.
Comment 5 Dan Langille freebsd_committer freebsd_triage 2023-09-10 14:36:16 UTC
This can be removed for FreeBSD 13.2 hosts, but must remain for FreeBSD 12.4 hosts.

re:

* https://github.com/freebsd/freebsd-src/blob/release/12.4.0/usr.sbin/services_mkdb/services
https://github.com/freebsd/freebsd-src/blob/release/13.2.0/usr.sbin/services_mkdb/services
Comment 6 Dan Langille freebsd_committer freebsd_triage 2023-09-10 15:10:49 UTC
Further review, indicates all versions < 1300000 need the pkg-install.server.in and pkg-deinstall.server.in

Testing on FreeBSD 12.4 indicates that sysutils/bacula*-client adds/removes the following in /etc/services:

# Bacula port start
bacula-dir      9101/tcp   #Bacula director daemon
bacula-fd       9102/tcp   #Bacula file daemon
bacula-sd       9103/tcp   #Bacula storage daemon
# Bacula port end

But that is handled by

* files/pkg-deinstall.client.in
* files/pkg-install.client.in

NOTE: the above two scripts only need to be invoked on FreeBSD < 1300000

NOTE: the install script already checks for bacula within /etc/service and does not add the values if found.

Conclusion: yeah, the pkg install/deinstall server scripts can be removed without affecting existing installations.
Comment 7 Dan Langille freebsd_committer freebsd_triage 2023-09-10 15:36:31 UTC
For my own notes, this messages in files/pkg-deinstall.client.in is not needed.

echo "To delete Bacula group permanently, use 'pw groupdel ${GROUP}'"

Because this is the deinstall process:

Proceed with deinstalling packages? [y/N]: y
[testing-bacula9.int.unixathome.org] [1/1] Deinstalling bacula13-client-13.0.1...
Check if /var/db/bacula is empty and delete it to permanently remove the bacula port.
To delete Bacula group permanently, use 'pw groupdel bacula'
[testing-bacula9.int.unixathome.org] [1/1] Deleting files for bacula13-client-13.0.1: 100%
==> You should manually remove the "bacula" user. 
==> You should manually remove the "bacula" group 

The extra message is redundant.
Comment 8 commit-hook freebsd_committer freebsd_triage 2023-09-10 15:40:30 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=a7d93b79e9ad5e103d8db701efc3966db31c7b64

commit a7d93b79e9ad5e103d8db701efc3966db31c7b64
Author:     Dan Langille <dvl@FreeBSD.org>
AuthorDate: 2023-09-10 15:17:27 +0000
Commit:     Dan Langille <dvl@FreeBSD.org>
CommitDate: 2023-09-10 15:40:07 +0000

    sysutils/bacula*-server: remove unused scripts

    Remove

    * files/pkg-deinstall.server.in
    * files/pkg-install.server.in

    They are not used. They duplicate the actions of the cliemt scripts.
    The server requires the client.

    PR:             273306

 .../files/pkg-deinstall.server.in (gone)           | 34 ----------------------
 .../files/pkg-install.server.in (gone)             | 13 ---------
 .../files/pkg-deinstall.server.in (gone)           | 34 ----------------------
 .../files/pkg-install.server.in (gone)             | 13 ---------
 .../files/pkg-deinstall.server.in (gone)           | 34 ----------------------
 .../files/pkg-install.server.in (gone)             | 13 ---------
 6 files changed, 141 deletions(-)
Comment 9 Dan Langille freebsd_committer freebsd_triage 2023-09-10 15:41:13 UTC
Thank you for your help.