-
Notifications
You must be signed in to change notification settings - Fork 26
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
deb: fix failure on purge (td-agent v4) #564
Comments
Verified with the following situation:
Then execute sudo apt purge td-agent. td-agent v4.5.0 is assumed that td-agent service must be stopped before purging td-agent package.
|
On jammy, td-agent is marked as rc. on the contract to it, td-agent is marked as ii on focal. jammy:
focal:
|
If you purge td-agent 5.0.0, no problem.
|
Hmm, can we really purge v4 safely? If a user upgrades to v5 from v4, I suppose that the v4 package should not be purged. The focal environment where the package is upgraded to v5 from v4: $ dpkg -l td-agent
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name Version Architecture Description
+++-==============-============-============-==================================================
rc td-agent 4.5.0-1 amd64 Treasure Agent: A data collector for Treasure Data
$ dpkg -L td-agent
/etc
/etc/logrotate.d
/etc/logrotate.d/td-agent
/etc/td-agent
/etc/td-agent/td-agent.conf
/opt
$ ls -la /etc/td-agent
lrwxrwxrwx 1 root root 11 Aug 8 08:24 /etc/td-agent -> /etc/fluent
$ ls -la /etc/fluent/
drwxr-xr-x 3 td-agent td-agent 4096 Aug 8 08:24 .
drwxr-xr-x 99 root root 4096 Aug 8 08:24 ..
lrwxrwxrwx 1 root root 25 Aug 8 08:24 fluentd.conf -> /etc/fluent/td-agent.conf
drwxr-xr-x 2 root root 4096 Aug 8 08:24 plugin
-rw-r--r-- 1 root root 2382 Aug 8 08:24 td-agent.conf For example, I suppose that we should not purge the config file: In addition, I wonder if this v4 fluent-package-builder/td-agent/templates/package-scripts/td-agent/deb/postrm Lines 7 to 24 in ac9ca53
|
I confirmed we can purge td-agent v4 without the error if we stop the service in advance. The focal environment where the package is upgraded to v5 from v4: $ sudo systemctl stop fluentd
$ sudo apt purge td-agent
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages will be REMOVED:
td-agent*
0 upgraded, 0 newly installed, 1 to remove and 194 not upgraded.
After this operation, 0 B of additional disk space will be used.
Do you want to continue? [Y/n]
(Reading database ... 50480 files and directories currently installed.)
Purging configuration files for td-agent (4.5.0-1) ...
td-agent:x:113:117::/var/lib/td-agent:/usr/sbin/nologin
userdel: group td-agent is the primary group of another user and is not removed.
userdel: td-agent mail spool (/var/mail/td-agent) not found # It seems to be no problem that the user `td-agent` is removed.
vagrant@vagrant:~$ getent passwd td-agent
(empty)
vagrant@vagrant:~$ getent passwd _fluentd
_fluentd:x:113:117::/var/lib/fluent:/usr/sbin/nologin
# The config file and the symbolic link are removed.
vagrant@vagrant:~$ la /etc/td-agent
ls: cannot access '/etc/td-agent': No such file or directory
vagrant@vagrant:~$ ls -la /etc/fluent
drwxr-xr-x 3 _fluentd td-agent 4096 Aug 8 09:09 .
drwxr-xr-x 99 root root 4096 Aug 8 09:09 ..
lrwxrwxrwx 1 root root 25 Aug 8 09:07 fluentd.conf -> /etc/fluent/td-agent.conf
drwxr-xr-x 2 root root 4096 Aug 8 09:07 plugin
# The log/buffer files and the symbolic link are cleared.
vagrant@vagrant:~$ ls -la /var/log/td-agent
ls: cannot access '/var/log/td-agent': No such file or directory
vagrant@vagrant:~$ ls -la /var/log/fluent/
drwxr-xr-x 2 _fluentd td-agent 4096 Aug 8 09:09 .
drwxrwxr-x 8 root syslog 4096 Aug 8 09:09 .. |
This is specification of Fluentd DEB package. |
According to fluent/fluentd-website#266, purge failure is reported.
The text was updated successfully, but these errors were encountered: