I'm developing a debian package and I want to add the following line in fstab while installing this package:
tmpfs /some/created/dir tmpfs defaults,noatime,nosuid,nodev,noexec,mode=0755,size=128M 0 0
How can I define this action?
I certainly wouldn't want any Debian package to change by fstab. This seems almost surely to be the wrong thing to do and it calls for trouble. /etc/fstab is meant as a file to be edited by a system administrator.
How do you make sure that the change does not interfer with the system administrator? He might already use the mount point for something else.
How would you revert the change when purging the package? You will be removing lines from fstab then? The sysadmin may have altered the line.
How do you make sure that the line will not get added twice when reinstalling?
After comments review I found that the mechanism that I'm looking for is a Package maintainer scripts and installation procedure. Thanks to @berndbausch for this.
I just need to add
debian/prerm executable and idempotent bash scripts with respecting actions. Here you can see my example.