Commit Graph

244 Commits

Author SHA1 Message Date
Marek Marczykowski-Górecki
0aae0c189c
Merge remote-tracking branch 'qubesos/pr/157'
* qubesos/pr/157:
  qubes-updates-proxy: make ShellCheck happy
  Use exec to ease systemd handling the tinyproxy process
  Handle tinyproxy path changed in upstream
2019-04-19 04:27:00 +02:00
Frédéric Pierret (fepitre)
94dad3640c
Use exec to ease systemd handling the tinyproxy process
From Marek's comments
2019-04-17 12:47:22 +02:00
Frédéric Pierret (fepitre)
0fd8da62b6
Handle tinyproxy path changed in upstream
Related commit 8d0ea71486
Fixes QubesOS/qubes-issues#4973 and QubesOS/qubes-issues#4929
2019-04-16 11:41:44 +02:00
Frédéric Pierret (fepitre)
dda290d511
Disable useless Xen services in Qubes VM since we use upstream package
QubesOS/qubes-issues#3945
2019-04-14 12:59:41 +02:00
Marek Marczykowski-Górecki
426f322c58
qrexec: add startup notification
Avoid race conditions with services ordered shortly after qrexec start.
Make systemd know when qrexec-agent is really ready to serve.

Fixes QubesOS/qubes-issues#3985
2018-12-08 12:32:56 +01:00
lvh
2f674c9168
Voice informational messages in bind-dirs.sh
Previously, bind-dirs.sh had a bunch of `true comment goes here` style debug messages (no-ops). Presumably this was done because these messages are intended as debug messages and would only be displayed when calling bind-dirs.sh with xtrace enabled. However, this includes some fatal errors, which are necessary to debug why bind-dirs.sh is ostensibly not working. For example, I tried to mount /var/lib/docker, didn't realize it did not exist (as an empty directory) in my base template, and there was no journalctl output at all. After this change, journalctl will contain the (very helpful) error message.
2018-10-01 16:07:01 -05:00
Marek Marczykowski-Górecki
c11dd76006
Merge remote-tracking branch 'qubesos/pr/125'
* qubesos/pr/125:
  bind mount /usr/local

Fixes QubesOS/qubes-issues#1150
2018-07-11 13:25:37 +02:00
Reynir Björnsson
86413df6d2
bind mount /usr/local 2018-07-11 11:14:47 +02:00
Marek Marczykowski-Górecki
4a8b10ea8b
Drop leftovers of qubes-netwatcher service
Fixes QubesOS/qubes-issues#1242
2018-05-24 17:38:12 +02:00
Marek Marczykowski-Górecki
f6dc28106b
qubes-firewall: signal service readiness only after initial scripts
qubes-firewall.service have Before=qubes-network.service. The latter
enable ip_forwarding. Make sure the ordering cover not only service
fork, but all its startup sequence, including initial rules and user
scripts.

Reported-by: @tasket
2018-04-20 16:38:25 +02:00
Marek Marczykowski-Górecki
76649d875b
Do not start dkms.service
It doesn't make sense in Qubes to rebuild modules at every VM startup.
Especially when modules dir is either read-only, or on non-persistent
root volume (TemplateBasedVM).
This is especially uneeded for dom0-provided kernels, which already have
u2mfn module built, but DKMS try to rebuild it anyway (and fails,
because of missing/broken kernel-devel package).
DKMS already have appropriate (rpm/dpkg) hooks for new kernel
installation, so actually needed modules should be build in template on
kernel update/install anyway.

This saves about 2s from VM startup time.
2018-04-04 01:50:40 +02:00
Rusty Bird
4247d4f699
Really enable qubes-sync-time.timer
'systemctl enable' (and thus the preset) needs an [Install] section.
2018-02-14 13:52:17 +00:00
Marek Marczykowski-Górecki
15301d3922
Merge remote-tracking branch 'qubesos/pr/91'
* qubesos/pr/91:
  bind-dirs.sh: don't fail on empty configuration directory
2018-02-13 04:42:34 +01:00
Marek Marczykowski-Górecki
e497858768
Fix systemd-timesyncd.service startup
Add After=qubes-sysinit.service to avoid startup condition being
evaluated before initializing qubes-service directory.

Fixes QubesOS/qubes-issues#3333
2018-02-13 02:14:08 +01:00
Rusty Bird
744cab8639
bind-dirs.sh: don't fail on empty configuration directory
nullglob must be active before a glob is used on a potentially empty
directory. Call shopt immediately after the shebang line.

Fixes QubesOS/qubes-issues#3552
2018-02-08 13:21:01 +00:00
unman
a95aa43864
Disable wpa_supplicant@.service
(cherry picked from commit 51f80d39a1064dd6075ccf6af1d5ba78fba6327c)
2017-12-14 23:22:06 +01:00
Marek Marczykowski-Górecki
715693b93d
network: IPv6-enabled firewall
If IPv6 is configured in the VM, and it is providing network to others,
apply IPv6 firewall similar to the IPv4 one (including NAT for outgoing
traffix), instead of blocking everything. Also, enable IP forwarding for
IPv6 in such a case.

Fixes QubesOS/qubes-issues#718
2017-12-07 01:41:55 +01:00
Marek Marczykowski-Górecki
414f944cf9
Disable cups-browsed service together with cups
It tries to connect to cups every second and doesn't do anything else
when cups is disabled. So disable (or enable) both of them at the same
time.
2017-12-05 17:58:35 +01:00
Marek Marczykowski-Górecki
3fb258db47
network: order qubes-firewall service before enabling IP forwarding
Start qubes-firewall (which will add "DROP by default" rule) before
enabling IP forwarding, to not leave a time slot where some connection
could go around configured firewall.

QubesOS/qubes-issues#3269
2017-11-20 02:42:39 +01:00
Marek Marczykowski-Górecki
c0e5501f55
Enable qubes-firewall also in "NetVM"
In some cases it may make sense to enfoce outgoing firewall also on
sys-net. If the service is disabled, firewall settings will be
(silently) ignored, so better be on the safe side and enable.

QubesOS/qubes-issues#3290
2017-11-20 01:56:15 +01:00
Marek Marczykowski-Górecki
e53db1386d
Dumb down meminfo-writer enabling logic
Let dom0 decide whether it should be enabled or not, regardless of PCI
devices or any other factor.

Fixes QubesOS/qubes-issues#3207
2017-11-20 01:56:15 +01:00
Marek Marczykowski-Górecki
2006b8494e
Fix starting time synchronization service
systemd-timesyncd.service isn't enough, for various reasons:
 - it is started too early in the boot process - files in
   /var/run/qubes-services are not yet there
 - by default it does only one shot synchronization, and there is no
   network at that early boot time yet
 - by default use-ntp is set to "no"

So, in addition, enable actual ntp client.

Fixes QubesOS/qubes-issues#3210
2017-11-03 03:12:55 +01:00
Marek Marczykowski-Górecki
1ed6e614ab
Resize root filesystem at VM startup if needed
Check if root device was enlarged while domain was powered off and
resize the filesystem in such a case.

QubesOS/qubes-issues#3173
QubesOS/qubes-issues#3143
2017-10-18 21:02:15 +02:00
Marek Marczykowski-Górecki
aad6fa6d19
Hint shellcheck where to look for sourced files, if in repository
This will ease running shellcheck from the repository.
2017-09-30 05:05:34 +02:00
Marek Marczykowski-Górecki
8bb152f76e
init: fix issues found by shellcheck in init scripts
Most of them are missing quotes, `` -> $(), and -o/-a usage in
conditions. Also add few directives disabling checks where were too
verbose.
2017-09-30 04:49:21 +02:00
Marta Marczykowska-Górecka
f55412cd1e
clock synchronization rewrite
clock synchronization mechanism rewritten to use systemd-timesync instead of NtpDate; at the moment, requires:
- modifying /etc/qubes-rpc/policy/qubes.GetDate to redirect GetDate to designated clockvm
- enabling clocksync service in clockvm ( qvm-features clockvm-name service/clocksync true )

Works as specified in issue listed below, except for:
- each VM synces with clockvm after boot and every 6h
- clockvm synces time with the Internet using systemd-timesync
- dom0 synces itself with clockvm every 1h (using cron)

fixes QubesOS/qubes-issues#1230
2017-07-06 23:37:26 +02:00
Marek Marczykowski-Górecki
68d98179f0
Do not load 'dummy-hcd' kernel module
It isn't really needed. It was used to workaround libusb bug (causing
crash when the system does not have any USB controller), but since we
use HVM now which do have some USB controllers it isn't needed anymore.

Also, it is not available in stock Fedora kernels.
2017-07-05 00:20:57 +02:00
Marek Marczykowski-Górecki
0bee339ffb
Cleanup kernel modules loading configuration
qubes-core-agent itself do not use u2mfn module.
2017-06-08 22:11:38 +02:00
Marek Marczykowski-Górecki
7e608a8bb4
Remove DisposableVM savefile related files
In Qubes 4.0 we no longer use two-stage DisposableVM startup.
2017-06-08 22:11:35 +02:00
Marek Marczykowski-Górecki
4514500ee6
Fix detection of PCI passthrough
Do not enable meminfo-writer (and in consequence qmemman) for the VM if
any real PCI device is present. Do not count qemu-emulated devices.
2017-05-26 05:25:30 +02:00
Marek Marczykowski-Górecki
b49ae50ad5
Implement qrexec-based connection to updates proxy
Configure package manager to use 127.0.0.1:8082 as proxy instead of
"magic" IP intercepted later. The listen on this port and whenever
new connection arrives, spawn qubes.UpdatesProxy service call (to
default target domain - subject to configuration in dom0) and connect
its stdin/out to the local TCP connection. This part use systemd.socket
unit in case of systemd, and ncat --exec otherwise.

On the other end - in target domain - simply pass stdin/out to updates
proxy (tinyproxy) running locally.

It's important to _not_ configure the same VM to both be updates proxy and
use it. In practice such configuration makes little sense - if VM can
access network (which is required to run updates proxy), package manager
can use it directly. Even if this network access is through some
VPN/Tor. If a single VM would be configured as both proxy provider and
proxy user, connection would loop back to itself. Because of this, proxy
connection redirection (to qrexec service) is disabled when the same VM
also run updates proxy.

Fixes QubesOS/qubes-issues#1854
2017-05-26 05:25:29 +02:00
Marek Marczykowski-Górecki
34fa6e7ced
debian: make haveged.service patch less intrusive...
...but installed on all Debian versions. This is mostly required by
vebose file list in debian/qubes-core-agent.install. But also make it
use new options when upstream will set them.

QubesOS/qubes-issues#2161
2017-05-22 17:30:06 +02:00
Marek Marczykowski-Górecki
ce70887a57
Merge branch 'core3-devel' 2017-05-20 14:43:53 +02:00
Marek Marczykowski-Górecki
13c99f1f10
systemd: fix race condition between qubes-db and qubes-early-vm-config
qubes-early-vm-config.service depend on qubes-db daemon running, to
retrieve various configuration parameters. But the startup ordering
declaration was missing

Fixes QubesOS/qubes-issues#2750
2017-05-14 23:13:26 +02:00
Marek Marczykowski-Górecki
d177e73bba
Merge remote-tracking branch 'qubesos/pr/43'
* qubesos/pr/43:
  Fix more shellcheck warnings
  Fix handling of binds containing spaces
2017-03-17 11:56:22 +01:00
Robin Schneider
e0814b481f
bind-dirs: Create ro if bind target exists
Before, the script skipped none existing ro paths even if the path
existed below /rw. This would require someone who wants to use bind-dirs
only in TemplateBasedVM to ensure that the paths exist before the
bind-dirs script gets called.

This patch changes this behavior so that if the path exists below /rw, it
is ensured that an (empty) file/directory is present in ro (where the
corresponding path from /rw is then bind mounted over).

Requires: Docs update. I can open a PR when this PRs looks good.
Fixes limitation: "Does not work if the file / folder in question does
  not already exist in the root image. I.e. a file that does not exist in
  the root image cannot be bind mounted in the TemplateBasedVM."
Example use case: https://github.com/debops/ansible-persistent_paths
Tested on: Qubes OS 3.2; Debian 8 TemplateBasedVM (and Template)
Related to: https://github.com/QubesOS/qubes-issues/issues/2661
2017-03-16 12:56:54 +01:00
Robin Schneider
a205c86bfe
Fix more shellcheck warnings 2017-03-14 20:13:23 +01:00
Robin Schneider
0facff3a01
Fix handling of binds containing spaces
```bash
binds+=( '/etc/tmp/s s' )
```

was handled incorrectly before.
2017-03-14 20:10:26 +01:00
unman
1ed2954f91
Stop unnecessary services in Debian 2017-02-16 22:41:14 +00:00
Marek Marczykowski-Górecki
08edfa630d
Merge remote-tracking branch 'qubesos/pr/35'
* qubesos/pr/35:
  Constrain cron and anacron in Ubuntu also
  Stop anacron from starting in Debian using existing constraint on cron
2017-02-12 23:59:43 +01:00
unman
a361fb454c
Stop anacron from starting in Debian using existing constraint on cron 2017-02-05 23:36:27 +00:00
Patrick Schleizer
3cc1a855dc comment 2016-12-21 00:15:12 +01:00
Marek Marczykowski-Górecki
41e3d591ef
Merge remote-tracking branch 'qubesos/pr/25'
* qubesos/pr/25:
  Add systemd override for haveged in xenial and stretch. (#2161) Reenable haveged.service after debian package installation

Fixes QubesOS/qubes-issues#2161
2016-11-28 15:02:32 +01:00
unman
58febd6d20
Add systemd override for haveged in xenial and stretch. (#2161)
Reenable haveged.service after debian package installation
2016-11-14 02:33:20 +00:00
Manuel Amador (Rudd-O)
6ca10b42eb Initialize home_volatile for disposable VMs. 2016-11-13 21:20:46 +00:00
Manuel Amador (Rudd-O)
251ecbd529 Clean up specfile unit activation aspect.
Up until today, Qubes OS would insist on either masking or disabling
or activating units that should get their state properly changed
but only on first package install (when the template is built).

This commit adds the possibility of having two types of unit presets:

* Initial presets: these are only changed state during first package
  installs.
* Upgrade presets: these get their state changed during first
  package installs as well as during upgrades.

All the maintainer has to do is abide by the instructions in the
preset file.  Nothing else is necessary.

Namely, this allows users to enable SSHD on their templates or
standalone VMs and still keep it enabled even after the
qubes-core-vm-systemd package is upgraded.

Matt really wanted that, and so did I, so now we can do it!

:-)
2016-10-28 08:35:36 +00:00
Manuel Amador (Rudd-O)
d15696ebef Fix VM settings running while / is readonly. 2016-10-28 05:21:40 +00:00
Manuel Amador (Rudd-O)
59aec8e5eb Clean up early initialization and setup of /rw 2016-10-23 20:19:51 +00:00
Marek Marczykowski-Górecki
b7c7b4ad52
Merge remote-tracking branch 'qubesos/pr/20'
* qubesos/pr/20:
  Eliminate race condition with qubes-setup-dnat-to-ns

Fixes QubesOS/qubes-issues#1067
2016-10-17 21:12:39 +02:00
unman
f04712cf02
Revert version and correct unit files 2016-10-16 13:39:01 +01:00