<div dir="ltr"><div>Good afternoon. <br>My name is Alexey<br>I write for the first time, hoping to get advice from you<br>Recently
 I started to try building a programs into Snap package. I need to build
 a demon. But unfortunatly there was a many problems due working. I 
faced on the lacking of documentation and description of the principle 
operation with demons.<br>I will try to describe the work and attaching a file with yaml file and binary file (f2d).<br>The
 system should work with 2 demons, snmpd and my own sub-agent. snmp 
service is working with system. sub-agent is handle our requests, which 
are not known for the snmpd.<br>snmp should be able to "--start" and "--stop".<br>sub-agent can running with different keys, for example ./f2d -Lo -n<br><br>My questions:<br>1. How to make packaging into snap pack with 2 demons if I want a program running only by root and with the keys?<br>2. How to work with file out of $SNAP?<br>3. I collect snmp, he unpackage /etc/snmp/snmpd.conf and then I want to replace it by my own snmpd.conf. how to do it?<br>4. The system have snmp. Could I install and work with other snmp in a program, if snmp was build in snap package?<br><br>The
 archive contains files *.mib.txt with information for snmp. If main 
snmpd doesn't knows *.mib.txt data they have sent sub-agent f2d.<br>f2d - sub-agent<br>f2d.dat
 - a data file which running with sub-agent and verify his changes. The 
file can be changed. In that build file must be located in 
/etc/snmp.data/f2d.dat<br><br><br>Thank you for your attention! <br>I really count upon your help.<br>I would be deeply grateful for all your advice.<br>Sincerely, Alexey<br><br></div>snapcraft.yaml<br><br>name: f2d<br>version: 0.1<br>summary: This is my-snap's summary<br>description: test snmp demon<br>confinement: strict<br><br>parts:<br>    f2d:<br>        plugin: copy<br>        files:<br>            bin/f2d : usr/bin/f2d<br>            bin/Alexey.MIB.txt : usr/share/snmp/mibs/alexey1.mib.txt<br>            bin/f2d.mib.txt : usr/share/snmp/mibs/f2d.mib.txt<br>            bin/f2d.dat : /etc/snmp.data/f2d.dat<br>            bin/snmpd.conf : etc/snmp/snmpd.conf<br><br>    integration:<br>        plugin: nil<br>        stage-packages:<br>            - snmp<br>            - snmpd<br>            - smitools<br><br>apps:<br>    f2d:<br>        command: usr/bin/f2d<br>        daemon: simple<br><br>    snmpd:<br>        command: etc/init.d/snmpd --start<br>        stop-command: etc/init.d/snmpd --stop<br>        daemon: forking<br>        plugs: ['network']<br></div>