Skip to content
This repository has been archived by the owner on Nov 8, 2022. It is now read-only.

(SDI-2199) Fix #1344 binary change to snaptel/snapteld #1357

Merged
merged 2 commits into from
Nov 21, 2016

Conversation

nanliu
Copy link
Contributor

@nanliu nanliu commented Nov 17, 2016

No description provided.

@@ -109,7 +109,7 @@ const (
defaultLogPath string = ""
defaultLogTruncate bool = false
defaultLogColors bool = true
defaultConfigPath string = "/etc/snap/snapd.conf"
defaultConfigPath string = "/etc/snap/snapteld.conf"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've made a note to symlink this as well in the packaging since this will be a breaking upgrade.

@@ -121,24 +121,22 @@ Tarball (choose the appropriate version and platform):
```
$ curl -sfLO https://github.com/intelsdi-x/snap/releases/download/0.18.0/snap-0.18.0-linux-amd64.tar.gz
$ tar xf snap-0.18.0-linux-amd64.tar.gz
$ cp snapd /usr/local/bin
$ cp snapctl /usr/local/bin
$ cp snapteld /usr/local/sbin
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does it make sense to put snapteld and snaptel in separate locations?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, same as /usr/sbin/sshd and /usr/bin/ssh.

```

Ubuntu 16.04.1 [snapd package version 2.13+](https://launchpad.net/ubuntu/+source/snapd) installs snapd/snapctl binary in /usr/bin. These executables are not related to snap-telemetry. Running `snapctl` from snapd package will result in the following error message:
If you installed snap-telemetry package, please make sure `/usr/local/bin:/usr/local/sbin` is part of your $PATH and has higher priority than `/usr/bin:/usr/sbin`, or invoke the snap-telemetry snapteld/snaptel binary using fully qualified path.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this referring to older versions only? Versions post-name change should be fine regardless of where /usr/local/(s)bin is in the path.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This can be dropped with the new binary name so I'll remove it.

@@ -157,15 +155,15 @@ $ systemctl start snap-telemetry
If you installed Snap from binary, you can start Snap daemon via the command:
```
$ sudo mkdir -p /var/log/snap
$ sudo snapd --plugin-trust 0 --log-level 1 -o /var/log/snap &
$ sudo snapteld --plugin-trust 0 --log-level 1 -o /var/log/snap &
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we change the -o to --log-path to match the other self-explanatory options?


snapd supports being configured through a configuration file located at a default location of `/etc/snap/snapd.conf` on Linux systems or by passing a configuration file in through the `--config` command line flag when starting snapd. YAML and JSON are currently supported for configuration file types.
snapteld supports being configured through a configuration file located at a default location of `/etc/snap/snapteld.conf` on Linux systems or by passing a configuration file in through the `--config` command line flag when starting snapteld. YAML and JSON are currently supported for configuration file types.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is the config file location going to stay as /etc/snap/ vs /etc/snaptel?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we can keep it /etc/snap since there's no conflicts. This will allow keyrings file to be kept in same location as well.

@@ -438,7 +438,7 @@ func action(ctx *cli.Context) error {
log.WithFields(
log.Fields{
"block": "main",
"_module": "snapd",
"_module": "snapteld",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of changing these all from snapd->snapteld, would it make sense to just instantiate a logger with the module set in one place? Or at least use a moduleName var?

@@ -17,11 +17,11 @@ See the License for the specific language governing permissions and
limitations under the License.
-->

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we want to keep this name for this file? What about docs/DAEMON_CONFIGURATION.md?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm going to defer any documentation link changes to SDI-2203. The goal for this PR is to fix the snaptel/snapteld binary, and have the installation steps match the new package location (sbin/bin).

If we have any documentation touch ups, they can be done post 0.19.0 release.

@kindermoumoute
Copy link
Contributor

I guess the GLOSSARY.md has to be updated too now it's merged.

@mbbroberg
Copy link
Contributor

Correct @kindermoumoute - whatever naming we choose for the file will need replacement in the glossary as well.

@nanliu
Copy link
Contributor Author

nanliu commented Nov 19, 2016

Once this is finalized, I'll squash it into one commit before merging. We plan to merge this on Monday before the 0.19.0 release.

```

Ubuntu 16.04.1 [snapd package version 2.13+](https://launchpad.net/ubuntu/+source/snapd) installs snapd/snapctl binary in /usr/bin. These executables are not related to snap-telemetry. Running `snapctl` from snapd package will result in the following error message:
NOTE: snap-telemetry packages prior to 0.19.0 installed `/usr/local/bin/{snapctl|snapd}` and these binaries have been renamed to `snaptel` and `snapteld`. snap-telemetry packages prior to 0.18.0 symlinked `/usr/bin/{snapctl|snapd}` to `/opt/snap/bin/{snapctl|snapd}` and may cause conflicts with [Ubuntu's `snapteld` package](http://packages.ubuntu.com/xenial-updates/snapd). Ubuntu 16.04.1 [snapteld package version 2.13+](https://launchpad.net/ubuntu/+source/snapd) installs snapd/snapctl binary in /usr/bin. These executables are not related to snap-telemetry. Running `snapctl` from snapd package will result in the following error message:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

and may cause conflicts with [Ubuntu's >>>>>snapteld<<< package]

>>>snapteld<<< package version 2.13+


```
$ snapctl
error: snapctl requires SNAP_CONTEXT environment variable
error: snaptel requires SNAP_CONTEXT environment variable
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Revert this.

@lmroz
Copy link
Contributor

lmroz commented Nov 21, 2016

There is /etc/snap/snapteld.conf but /etc/snapteld/plugins/ (CTRL+F for /etc/, I don't remember exact location).

@nanliu
Copy link
Contributor Author

nanliu commented Nov 21, 2016

@lmroz found /etc/snapteld/plugins and changed it to /opt/snap/plugins since that's our package default. Thanks for tracking down all the inconsistencies.

Copy link
Contributor

@kindermoumoute kindermoumoute left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@nanliu nanliu merged commit cd9c1a8 into intelsdi-x:master Nov 21, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants