Age | Commit message (Collapse) | Author |
|
* Add basic runit service script for Netdata.
* Integrate runit handling in install-service script.
* Add new runit script to .gitignore.
* Fix service file installation.
We need to ensure the service directory actually gets created, and thus
need to use `-D` with the `install` command.
* Sync with system restructure.
* Fix botched update to Makefile.am.
|
|
Co-authored-by: ilyam8 <ilya@netdata.cloud>
|
|
|
|
service. (#14658)
|
|
* Add OpenRC conf.d file for Netdata.
* Tidy-up handling of retry schedule.
It should be computed in stop_pre so it gets evaluated after the conf
file, and it also needs to handle variables not being defined properly
(which it currently does not).
* Add a service description and command descriptions.
* Only install `/etc/conf.d/netdata` if it does not already exist.
This prevents overwriting user configuration.
|
|
for. (#14544)
* Move systemd-specific system files to their own directory.
* Move non-systemd init scripts to individual subdirectories.
* Move cron files to their own directory.
* Move logrotate config to it’s own directory.
* Fix typos in Makefile.am.
* Fix Debian package builds.
* Fixed issues reported by @andrewm4894.
|
|
Co-authored-by: Ilya Mashchenko <ilya@netdata.cloud>
|
|
* Add shellcheck config file to globally disable dead code checks.
These checks have an extremely high false positive rate and even when
they’re correctly flagging code the impact is generally very low.
* Fix assorted shellcheck errors in installer code.
This should make reviewing PRs relating to this code much easier.
* Make shellcheck quit complaining about shellcheckrc formatting.
|
|
|
|
systemd service (#14255)
Fixes https://github.com/netdata/netdata/issues/14238
|
|
|
|
(#14073)
|
|
* Cleanly reimplement system/edit-config.in
- Added support for pulling config files from Docker containers.
- Added auto-detection for Docker containers.
- Use directory the script is in for target directory for config files
instead of templating it in at build time.
- Prefix error messages with `ERROR:`.
- Robustly check for a valid editor _before_ invoking it.
- Add support for actual command-line options, including a proper
`--help` option.
- Use prefix matching of absolute paths to determine file validity
instead of blindly excluding certain path types.
- If editing a non-existing file we do not provide a stock copy of,
create an empty file instead of throwing an error.
- Make the whole script properly modular.
* Improve robustness of container autodetection.
Instead of relying on the lack of certain directories on a host system,
use some relatively standard checks to determine if we appear to be
running in a container.
* Auto-detect stock config paths at runtinme instead of hard-coding them at build time.
THis will simplify testing of the script, as well as making it a bit
more resilient to users moving things around.
* Add an option to list known config files.
* Fix container environment check to not require root.
* Fix help output.
* Fix path prefix check.
* Fix file path handling.
* Use correct variable when editing files.
* Use correct path for `env`.
* Source profile before running `set -e`.
To prevent questionablly written profiles from causing the script to
exit.
* Produce columnar output when listing valid files.
* Fix copy check.
* Fix build issues.
* fix build issues
* formatting
Co-authored-by: ilyam8 <ilya@netdata.cloud>
|
|
* Properly handle service dependencies in OpenRC init script.
This removes the `NETDATA_START_AFTER_SERVICES` variable from our OpenRC
script. This variable made the script somewhat harder to read, and did
not actually provide any additional functionality (users can simply
define appropriate `rc_after` values in `/etc/conf.d/netdata` to achieve
exactly the same net effect)..
* Provide more concrete descriptions for OpenRC commands.
Updates the command descriptions in the OpenRC init script to properly
describe exactly what they are doing, instead of going with generic and
rather ambiguous names.
* Allow use of netdatacli for additional commands in OpenRC init script.
This makes life simpler for users who want to run the agent under
OpenRC’s native process supervision, which does not allow use of
`start-stop-daemon` commands in the init script.
Existing behavior (using `start-stop-daemon`) is preserved as the
default.
* Fix background command handling.
THe `pidfile` variable should only be set if the agent is not being run
under `supervise-daemon`.
* COnsolidate code from additional commands, and handle supervise-daemon correctly.
* Fix typo.
* Remove pointless `require_files` line.
We don’t actually do anything in the script that cares about the config
file existing, and the agent starts fine without it, so we should not be
requiring it to be present.
|
|
managers. (#13848)
|
|
* Fix runtime directory ownership when installed as non-root user.
Followup to #13870.
* Fix typo.
|
|
Instead of using the correct path for installing the system service
file, we were always hard-coding `/etc/init.d/netdata`. This happened to
work correctly on Linux, but obviously breaks horribly on FreeBSD.
|
|
* Improve OpenRC detection.
- Check for rc-update command, without that we don’t work so it’s ‘not
OpenRC’.
- Sort checks so that less expensive ones run first.
- If we see `/etc/init.d/local` and it’s got a shebang line with
`openrc-run`, then assume we’re dealing with OpenRC. This file gets
installed by default as part of OpenRC itself.
* Fix runit detection.
- `/lib/rc/sv.d` is only used on some runit systems (notably Artix), not
all, so don’t bail if we can’t find it.
- Check not just for a `runit` command, but also `runsvdir`.
* Add support for systemd in WSL.
THis just involves running the normal systemd check if we detected WSL,
and updating the service manager type appropriately.
* Fix tmpdir handling for service installation.
* Fix invocation of service install script.
* Add fallback to detected but not running service managers.
Currently supported for systemd and OpenRC. If no other service manager
is detected, but we detected that either systemd or OpenRC is present
but not running, fall back to them instead of outright failing.
This does not allow starting/stopping the agent using the service manager,
but _does_ happen to work for installing the service properly on an
offline system.
* Fix service-type fallback handling.
If we see systemd, even if it not booted into it, we should not install
init.d or LSB init scripts.
* Fix recursion bug in initd install type checking.
* Skip initd if OpenRC is found.
Just like systemd, any OpenRC on the system automatically means that
it’s _not_ a classic init.d setup.
* Fall back to init.d in WSL in some cases.
If there is no _usable_ systemd, and the service manager otherwise looks
like an init.d setup, fall back to an init.d setup.
* Support LSB style init scripts in WSL as well.
Also consolidate and update the error message that gets printed when
running under WSL.
* Fix typo in LSB init script handling code.
* Fix command handling for LSB and initd service management.
Instead of using `service`, just run the init scripts directly. This way
we avoid any bugs in `service` that would cause it to pretend that
systemd is in use even though it isn’t.
* Fix botched partial commit.
* Restructure service type detection to not rely on return codes.
* Added option to display service type detection results.
This should simplify debugging.
|
|
* allow netdata installer to install and run netdata as any user
* Update netdata-installer.sh
Co-authored-by: Austin S. Hemmelgarn <ahferroin7@gmail.com>
* Update netdata-installer.sh
Co-authored-by: Austin S. Hemmelgarn <ahferroin7@gmail.com>
Co-authored-by: Austin S. Hemmelgarn <ahferroin7@gmail.com>
|
|
* Install templated files from system directory on target system.
This will allow more robust handling of auto-updates and installation of
service files.
* Add a script to handle installing Netdata as a system service.
This uses the files installed as a result of the previous commit, and
provides more robust detection and system handling than the existing
code used for this purpose.
A subsequent commit will convert the various installation mechanisms to
use this script instead of their own internal code for this purpose.
* Assorted cleanup and fixes for install-service.sh script.
* Use new service install script on installs when present.
* Fix missing .gitignore line.
* Fix install command.
* Integrate with warning handling in kickstart script.
* Fix systemd version check.
* Explicitly exit successfully when done.
* Further fixes.
* Fix handling of start commands on service install.
* Fix handling of passing service commands in installer.
* Fix handling of inability to detect service manager type.
* Centralize install-service.sh invocation and improve error reporting.
* Fix typos in Linux service handling.
|
|
Resolves warning logged by systemd:
systemd[1]: /lib/systemd/system/netdata.service:14: PIDFile= references a path below legacy directory /var/run/, updating /var/run/netdata/netdata.pid → /run/netdata/netdata.pid; please update the unit file accordingly.
Signed-off-by: Craig Andrews <candrews@integralblue.com>
Signed-off-by: Craig Andrews <candrews@integralblue.com>
|
|
|
|
|
|
|
|
(#12529)
|
|
|
|
|
|
|
|
Signed-off-by: Steven Noonan <steven@uplinklabs.net>
|
|
Co-authored-by: Ilya Mashchenko <ilya@netdata.cloud>
|
|
|
|
|
|
|
|
* Store info about the installation type for later retrieval.
* Properly handle install type on updates.
* Restructure install type values for easier parsing.
* Fix checksums.
* Fix .gitignore check.
|
|
* Fix systemd comment syntax
comments for systemd service files are only allowed in the beginning of a new line
https://www.freedesktop.org/software/systemd/man/systemd.syntax.html
otherwise you get error messages like
```
/usr/lib/systemd/system/netdata.service:48: Failed to parse capability in bounding/ambient set, ignoring: #
```
* remove trailing whitespaces
|
|
* Add systemd timer unit to handle auto updates.
This adds a systemd timer unit and associated service for running the
updaterscript. This allows better support for auto-updates on systems
that use systemd, removing the need for cron or special shims to handle
periodic tasks.
This will be used in preference to our existing auto-update support on
systems running systemd unless the user overrides this behavior.
* Add an option to the installer to override auto-updater type detection.
This allows users to specify what auto-updater scheduling mechanism to
use. This wil persist the selection to updates as well.
Supported values are:
* systemd': Uses a systemd timer unit and service to handle automatic
updates.
* 'interval': Uses a script in /etc/cron.daily or /etc/periodic/daily.
* `crontab`: Uses a crontab file in /etc/cron.d.
* Change priority of systemd support.
This way existing users won't get converted, and by default you'll still
get emails on failures.
* Case-normalize the value passed to --auto-update-type.
* Fix incorrect naming of crontab file.
* Fixed function naming.
|
|
* Add crontab fragment for netdata updater.
This adds a crontab fragment to be put in `/etc/cron.d` on system swhich
do not support either `/etc/cron.daily` or `/etc/periodic/daily`,
allowing for proper auto-updater support on such systems.
The crontab will run upates at 02:57, which was chosen arbitrarily
because it does not conflict with th erun times for any major
distribution's daily scheduled tasks.
* Utilize the crontab fragment for updates on systems that need it.
This adds logic to utilize the crontab fragment added by the previous
commit on systems which need it for auto-updates to work. The installer
will preferentially use `/etc/cron.daily` or `/etc/periodic/daily`
instead if they exist, so this should result in no changes for most
users.
* Remove systemd scheduler detection.
We're not actually using it right now, and it breaks handling of
auto-updates on systemd systems.
|
|
Since commit #9234 the following has been showing up in my journal logs:
> /lib/systemd/system/netdata.service:63: Unknown lvalue 'PrivateMounts' in section 'Service'
Running `systemd-analyze verify netdata.service`
> /lib/systemd/system/netdata.service:63: Unknown lvalue 'PrivateMounts' in section 'Service'
> Attempted to remove disk file system, and we can't allow that.
It would appear that the `Attempted to remove disk file system, and we can't allow that.` message is due to a [bug](https://github.com/systemd/systemd/issues/8592) in version 237 of systemd, which is what my Ubuntu 18.04 is currently running. But that doesn't explain the "PrivateMounts" issue.
Looking at the [systemd man page](https://www.freedesktop.org/software/systemd/man/systemd.exec.html) for PrivateMounts it would seem that we do not need the `PrivateMounts=true` setting because the service file has `ProtectSystem=full` set:
> Other file system namespace unit settings — PrivateMounts=, PrivateTmp=, PrivateDevices=, ProtectSystem=, ProtectHome=, ReadOnlyPaths=, InaccessiblePaths=, ReadWritePaths=, … — also enable file system namespacing in a fashion equivalent to this option. Hence it is primarily useful to explicitly request this behaviour if none of the other settings are used.
I have tested this on Ubuntu 18.04 and everything seems to be working fine.
|
|
|
|
This marks `/run/netdata` as writable in our systemd unit files so that
users who are listening on a UNIX socket in the 'standard' location can
do so witout the sandboxing getting in their way.
|
|
This mitigates failures in the eBPF plugin. The issue is a `setrlimi()`
call we're making to allow us to call `memlock()`. The proper fix here
is dependent on whether we can prove that we actually need to call
`memlock()` or not (I suspect we do not _need_ to but it improves
measurement accuracy, in which case it should be optional). If we can,
then this is also a fix and not a mitigation. If we can't, then the fix
is to get rid of those calls in the eBPF plugin and remove this othewise
unneeded capability from our bounding set.
|
|
|
|
Fix reported bugs with ebpf.plugin.
|
|
(#8454)
* Update netdata.service.v235.in too
Increase timeout for systemd service shutdown to give time to flush the db.
When changes are made to netdata.service.in similar changes should be made to netdata.service.v235.in too.
* bind to should be in [web] section
See documentation:
https://docs.netdata.cloud/web/server/
|
|
expect. (#8468)
* update netdata.conf for debian build
* Fix Debian Ubuntu SystemD Unit packaging
* avoid duplicate netdata.conf files
violates single source of truth principle, use schema from #8468 instead
* Fixed *DirectoryMode octets and bad ExecStart
* Fix dpkg-statoverride warnings
* Move the copy of debian/netdata.conf into the correct target (override_dh_install)
Co-authored-by: and0x000 <justanpc@gmail.com>
|
|
* Disallow multiple streaming connections to the same master agent
* Reject multiple streaming connections quickly without blocking
* Increase timeout for systemd service shutdown to give time to flush the db.
* Optimize page correlation ID to use atomic counter instead of locks
* Reduce contention in global configuration mutex
* Optimize complexity of inserting configuration sections from O(N) to O(1)
* Reduce overhead of clockgettime() by utilizing CLOCK_MONOTONIC_COARSE when applicable.
* Fix unit test compile errors
|
|
symlinked /opt (#7933)
* Re-formated ./system/edit-config.in with shfmt -w -i 2 -ci -sr
* Fixed and cleaned up ./system/edit-config to work correctly with symlinks
|
|
|
|
* Provide a new service file for systemd v235+
Let systemd create directories, instead of via ExecStartPre.
* Do not set global options in service file via -W option.
The default set by service file are anyway the defaults used by
netdata. Better place is to mention them in netdata.conf and
allow user to change those options via netdata.conf file instead
of changing in service file.
|
|
* make install takes care of ownership and permissions of /etc/netdata
Instead of netdata-installer.sh
* Fix identation in Makefile.am files
* netdata-installer.sh: Clearer variable assignment
* netdata-installer.sh: Set /etc/netdata/netdata.conf ownership to root:root and permissions to 0644
* netdata-installer.sh: Set /etc/netdata/.environment permissions to 0644
* install-or-update.sh: Set permissions for /opt/netdata/etc/netdata.conf to 0644
* install-or-update.sh: Use ${NETDATA_PREFIX} more
* install-or-update.sh: Improve indentation
* install-or-update.sh: Do not create /opt/netdata/etc/netdata directories
* debian/rules: /etc/netdata files and directories are now installed by make install
* debian/rules: Properly copy files across directories
When destination directory exists
* netdata.spec.in: /etc/netdata ownership and permissions
* Revert "Fix identation in Makefile.am files"
This reverts commit 63fdb299b69152fda6984f81b0fef02f364c5efe.
* Remove uninstall-local recipes from Makefile.am files
* Removed superfluous whitespace and hash
|