I need to create a service for a web server called daphne I would like to know what are the correct linux permissions for this. or if exists a general rule for whatever systemd service?
Any local user can read the definition of any systemd system unit through the DBus interface (for example using
systemctl show someUnitName), unless you have a custom DBus policy in place to prevent this.
Making the unit file not world-readable thus makes no sense and systemd will print a warning if applicable. Similarly, it will also warn if the unit file is marked executable.
Unless you want the unit file to be editable for a particular (non-root) user or group, stick to the same convention used for most other system files: 0644 root:root.