Hello,
This is how I currently write service log file:
service:
command: bin/auto-cpufreq --daemon 2>&1 | tee -a $SNAP_DATA/auto-cpufreq.log
Link to snapcraft.yaml. I did it like this because I wanted to replicate how logging is happening for non snap installs which works great.
With snap installs, users are also complaining that this approach is polluting the /var/log/syslog
Hence, as part of my effort to resolve this problem and wanting to move to core20. Now during the snapcraft
process I run into following error:
Skipping build deploy-cpufrectl (already ran)
Cleaning later steps and re-staging auto-cpufreq ('build' step changed)
Skipping stage deploy-cpufrectl (already ran)
Priming auto-cpufreq
Skipping prime deploy-cpufrectl (already ran)
Failed to generate snap metadata: The specified command 'bin/auto-cpufreq --daemon 2>&1 | tee -a $SNAP_DATA/auto-cpufreq.log' defined in the app 'service' does not match the pattern expected by snapd.
The command must consist only of alphanumeric characters, spaces, and the following special characters: / . _ # : $ -
Run the same command again with --debug to shell into the environment if you wish to introspect this failure.
Could someone please suggest an idea how I could properly write app output to $SNAP_DATA/auto-cpufreq.log
without polluting /var/log/syslog?
Thanks,
Adnan