atop is installed, it also installs a system service that keeps running it in the background. The service is started every time the computer is started.
In addition, packages can have (and often have) scripts that are automatically run before installation, after installation, before removal, and after removal.
In the case of
atop, there is a post-install script (
/var/lib/dpkg/info/atop.postinst) that runs
invoke-rc.d atop start. This is pretty typical on Debian-based systems: when you install a service, it gets automatically started.
So, what is does this
atop service do? Reading
/etc/init.d/atop, it ends up running the following (where
$CURDAY stands for the current day, for example
20161220 at the time of writing):
/usr/bin/atop -a -w /var/log/atop/atop_$CURDAY 600
According to the man page, this keeps one
atop command running all the time, writing raw data under
/var/log/atop every 10 minutes (600 seconds), forever (until the machine is shut down). This allows the user to examine past usage of the system, not just current usage. Have a look at the RAW DATA STORAGE section of the man page.
atop apparently crashes on your machine, you get one crash when the package is installed (and the service is started) and one crash each time the computer is started (because this starts the service). There is also a
cron job that restarts the service at midnight (so that a new log file is used every day), so you will get one more crash at midnight.
If you only care about running
atop from the command line, and do not care about the service, you can disable it by running
sudo update-rc.d atop disable.