We are facing an error while installing the newly created snap
padaga2016@localhost:~/snap/nttdatahelloworld$ sudo snap install nttdatahelloworld_2.0_amd64.snap --dangerous
error: cannot perform the following tasks:
Start snap “nttdatahelloworld” (unset) services ([start snap.nttdatahelloworld.nttdatahelloworld.service] failed with exit status 1: Job for snap.nttdatahelloworld.nttdatahelloworld.service failed because the control process exited with error code. See “systemctl status snap.nttdatahelloworld.nttdatahelloworld.service” and “journalctl -xe” for details.
)
Thanks @mborzecki . we have created a daemon for running a script file… i didnt see any require output
Please find my snapcraft.yaml & script files for your refernce.,
###snapcraft#####
name: nttdatahelloworld
version: ‘2.0’
summary: Outputs the contents of /etc/os-release
description: Prints the contents of os-release
grade: stable
confinement: strict
apps:
nttdatahelloworld:
command: bin/nttdatahelloworld.sh
daemon: oneshot
parts:
nttdatahelloworld:
plugin: dump
source: .
organize:
nttdatahelloworld.sh: bin/
plugs:
nttdatahelloworld-home:
interface: home
nttdatahelloworld-network:
interface: network
You probably need to write some code to enumerate the scripts in that directory and then run them. If you want to distribute your application as a snap you will need to use the home interface.
However, a daemon is typically run by root, in which case a strictly confined app will not be able to access /home/<someuser>, as AppArmor profile will prevent this. I suggest you try to read a bit more about snaps or some other containerization technologies, as those may not be the best pick if you need to run some scripts from arbitrary locations. Perhaps all you need is a cron job really.