Skip to main content

a silhouette of a person's head and shoulders, used as a default avatar

7 sudo myths debunked

Whether attending conferences or reading blogs, I often hear several misconceptions about sudo. Most of these misconceptions focus on security, flexibility, and central management. In this article, I will debunk some of these myths.

Many misconceptions likely arise because users know only the basic functionality of sudo. The sudoers file, by default, has only two rules: The root user, and members of the administrative wheel group, can do practically anything using sudo. There are barely any limits, and optional features are not enabled at all. Even this setup is better than sharing the root password, as you can usually follow who did what on your systems using the logs. However, learning some of the lesser-known old and new features gives you much more control and visibility on your systems.

In my latest opensource.com article, I debunk seven of the sudo myths: https://opensource.com/article/22/8/debunk-sudo-myths

a silhouette of a person's head and shoulders, used as a default avatar

Recordatorio: Presenta tu charla a Akademy-es 2022 de Barcelona #akademyes

A diferencia del año anterior, Akademy-es 2022 se celebrará en línea el 29 y 30 de septiembre. Estamos ya solo a dos meses mal contados así que no os despistéis mucho ya que se acaba de abrir el Call for Papers, es decir, el momento de participar activamente en el evento. Así que hoy tova recordatorio: presenta tu charla a Akademy-es 2022 de Barcelona y muestra al mundo tu proyecto.

Recordatorio: Presenta tu charla a Akademy-es 2022 de Barcelona

Hace unos días compartí con vosotros que este año Akademy-es 2022 se va a realizar de forma híbrida en Barcelona el 29 y 30 de septiembre, en una edición muy especial ya que volveremos a encontrarnos de forma física pero que seguirá siendo accesible para todo el mundo utilizando tecnologías de telecomunicación libres.

Siguiendo el esquema habitual cuando coincide con una Akademy, las charlas se celebrarán el jueves y el viernes, para dejar libre el fin de semana para las ponencias el evento Internacional.

Si crees que tienes algo importante que presentar, por favor házselo saber a la organización. Y si crees que alguien debería presentar su ponencia, no dejes de animarlo para que lo haga. Todas las contribuciones son útiles.

Recordatorio: Presenta tu charla a Akademy-es 2022 de Barcelona #akademyes
Adrián Chaves y Albert Astals en la Akademy-es 2018 de València

Para más detalles, mira las líneas generales del Call for Papers. Tienes de plazo para enviar tu propuesta hasta el domingo 29 de agosto 23:59:59 CEST al correo akademy-es-org@kde-espana.org.

Es importante tener en cuenta las siguientes consideraciones:

  • Se puede elegir entre dos formatos de charlas:
    • Charlas de 45 minutos.
    • Charlas relámpago (Lightning talk) de 10 minutos.
  • Si la duración de las charlas propuestas no se ajusta a ninguno de estos dos esquemas (por ejemplo, si se necesita más tiempo), esto debe indicarse claramente en la comunicación.
  • Se permitirá a KDE España la distribución bajo una licencia libre de todo el material utilizado para la realización de la actividad, así como de la grabación de la misma.
  • La charla puede ser tanto a nivel de usuario como de nivel técnico.

¿Qué es Akademy-es?

Akademy-es (#akademyes, que es la etiqueta para las redes sociales) es evento más importante para los desarrolladores y simpatizantes de KDE, que se ha ido celebrando desde el 2006 con éxito creciente.

En general, las Akademy-es son el lugar adecuado para conocer a los desarrolladores, diseñadores, traductores, usuarios y empresas  que mueven este gran proyecto.

En ellas se realizan ponencias, se presentan programas, se hace un poco de caja para los proyectos libres (camisetas, chapas, etc) pero sobre todo se conoce a gente muy interesante y se cargan baterías para el futuro.

Podéis repasar las anteriores ediciones en estas entradas del blog:

La entrada Recordatorio: Presenta tu charla a Akademy-es 2022 de Barcelona #akademyes se publicó primero en KDE Blog.

the avatar of YaST Team

YaST Development Report - Chapter 7 of 2022

Lately in this blog we have been covering mostly developments in the area of ALP (Adaptable Linux Platform), although we never stopped improving how YaST works on our currently maintained systems. In this report we will start by taking a look to an installer feature we plan to release soon for openSUSE Tumbleweed and also as a maintenance update for the current versions of Leap and SUSE Linux Enterprise. Of course, that will not stop us from offering you a sneak peek about the mid-term future. The whole menu includes:

  • Presenting the new mechanism to validate security policies during installation
  • An announcement of the official YaST container images
  • Some reports about the current state on ALP of both Cockpit and YaST
  • An update on the development of Iguana and D-Installer

Security Policies in the Installer

We all know there is a series of good practices that must be observed when installing and administering any computer system in order to minimize the security hazards. In some cases, those good practices are formalized into a so-called security policy that defines the guidelines that must be observed in order for a given system to be accepted in a secure environment. In that regard, the DISA (Defense Information Systems Agency) and SUSE have authored a STIG (Secure Technical Implementation Guide) that describes how to harden a SUSE Linux Enterprise system.

The STIG is a long list of rules, each containing description, detection of problems and how to remediate problems on a per rule basis. There are even some tools to automate the detection and remediation of many of the problems in an already installed systems. But some aspects are very hard to correct if they are not properly set during the installation process of the operating system, like the need of encrypting all the relevant filesystems or honoring certain restrictions in how the devices are formatted and the mount points are defined.

So we are actively working on adding the concept of security policies to both the interactive installation and AutoYaST. It is still a work in progress and we will offer a more detailed review of the feature when it’s ready to hit the repositories.

The installer checking the DISA STIG

Official YaST Container Images

On other news, you know we have been working on making possible to execute YaST as a container. So far, it was necessary to execute a script in order to use the containerized version of YaST. It was even available as a package on openSUSE Tumbleweed. But now, with the recent advances on ALP and its concept of so-called workloads, we found a better way to distribute the YaST containers.

We have now three “official” containers for YaST. available at the repository SUSE:ALP:Workloads. Although the repository, as the name suggests, is supposed to provide containerized workloads to be executed on top of ALP, we have decided it will be the official source for containerized YaST no matter if you execute it on top of ALP, the latest SLE, the latest Leap or openSUSE Tumbleweed. It should work the same in all cases.

So from now on, you can execute a containerized YaST anywhere by doing:

podman container runlabel run 
registry.opensuse.org/suse/alp/workloads/tumbleweed_containerfiles/suse/alp/workloads/yast-mgmt-ncurses:latest

Replace “ncurses” by “qt” or “web” to enjoy the alternative versions.

The route is a bit redundant and maybe it will change in the future, but that’s out of the control of the YaST Team. In any case, we will always use the official repository for ALP workloads.

For more details, see the full announcement at the archive of the yast-devel mailing list.

Additionally, we are also proud of remarking that those container images include the YaST Kdump and YaST Bootloader modules. We recently adapted them to work containerized, which we consider an important milestone because it implies libstorage-ng is now able to perform a system analysis of the running host system from a container.

YaST on ALP

As you know, the main motivation to containerize YaST was making it available to ALP users. But ALP is a new concept in Linux distributions with an innovative approach to some areas of system management. So we didn’t expect YaST, containerized or not, to just work smooth out-of-the-box on top of ALP. Thus, we are doing a continuous evaluation of the situation in the early previews of ALP to detect the areas of YaST (or even ALP itself) that need fixing and to decide where to put the focus on every given moment.

The good news is that most things seems to work in the non-transactional variant of ALP. We only detected small problems that we are now tracking and will fix step by step as time permits.

But on transactional ALP systems, which likely will be the default version in most scenarios, we have a very visible problem with software installation. YaST does not use static RPM dependencies to enforce beforehand the installation of the tools it relies on. Instead, YaST installs any needed software on demand during its execution. That’s a problem in a transactional system, as defined by ALP or openSUSE MicroOS. On the bright side, we checked that working-around the software installation problem, most of the other functionality works just fine also in a transactional ALP system with the only exception of the previously mentioned YaST Kdump and YaST Bootloader. Although those two modules work fine containerized in any non-transactional system, we still need to find a way for them in situations in which /boot is not directly writeable.

In short, things look relatively promising for YaST on ALP, but we still need to do a lot of adjustments here and there. We will keep you informed of the progress.

What About Cockpit?

As already mentioned, ALP is an innovative system and that not only affects YaST. Cockpit, the default platform for 1:1 system administration on ALP, also struggles with some of the particularities of the first prototypes of ALP, especially in its transactional flavor.

Thus, we are also investing quite some time testing all the Cockpit functionality on ALP and documenting which parts need tweaking… or even rethinking the Cockpit or the ALP approaches to some topics. As with the YaST case, we are already working on some aspects and we will keep you informed as long as we solve every existing problem.

Moving Forward with Iguana and D-Installer

Talking about ALP, you know we are using it as an opportunity to rethink how the (open)SUSE systems may be installed in the future on real hardware with complex requirements in terms of storage technologies, network setup, etc. In that regard, we keep developing D-Installer and Iguana.

In the case of the former, most recent news are about the internal architecture. You may remember from previous reports that we are trying to make D-Installer as modular as possible with separate processes to handle software management, creation of users, internationalization, etc. To make that mechanism more powerful, we defined now a D-Bus API so the different processes can interact with the user from a centralized user interface. See more details in the corresponding pull request.

In the case of Iguana we are focusing of expanding its scope (eg. making it useful in the context of Saltboot) and documentation. The Iguana Orchestrator (iguana-workflow) now comes with some examples for possible uses like running D-Installer as a set of two separate containers, one for the back-end and another for the web interface. If you want to run you own experiments, installing the iguana package from OBS will install a kernel and iguana-initrd, which then can be used for PXE boot or for direct kernel boot in virtual machines.

More to come

As you can see, we are actively working on many areas. So we hope to have all kind of news for you in the next report. Meanwhile, we hope you got enough to keep you interested. Keep having a lot of fun!

a silhouette of a person's head and shoulders, used as a default avatar

Las novedades de KDE Itinerary de KDE Gear 22.08

La Comunidad KDE anunció hace unos días que había sido lanzado KDE Gear 22.08, la gran actualización de sus aplicaciones que tiene una periodicidad cuatrimestral. De esta forma, se nos presentan decenas de cambios importantes, una ingente cantidad de bugs solucionados y mejoras en las traducciones. Es hora de ir descubriendo poco a poco cuáles han sido. Hace un par de días empezamos con Spectacle, el capturador de pantalla del escritorio Plasma, ayer seguimos con Kalendar y hoy toca hablar de las novedades de KDE Itinerary de KDE Gear 22.08, la competencia directa del módulo KOrganizer de Kontact.

Las novedades de KDE Itinerary de KDE Gear 22.08

Dentro del lanzamiento de KDE Gear 22.08 muchas aplicaciones han recibido mucho cariño, y una de ellas es una de las aplicaciones que con más impetu ha ido creciendo en los últimos tiempos y que no he tenido la oportunidad (porque a veces de soy así de despistado) de promocionar en el blog.

Se trata de KDE Itinerary, el asistente de viajes de KDE, que nos ayuda a planificar nuestro viaje. De esta forma se encarga de la gestión de los billetes, tarjetas de embarque e incluso de sus certificados sanitarios (ahora que todavía son necesarios). Además nos sirve de guía por aeropuertos, estaciones de trenes y autobuses, y otros intercambiadores de transporte.

Las novedades de Kalendar de KDE Gear 22.08

Como decía, la aplicación está creciendo a buen ritmo y los desarrolladores de Itinerary se han preocupado mucho de segur aumentando las prestaciones de esta herramienta:

De esta forma, las novedades de Spectacle de KDE Gear 22.08 son las siguientes:

  • Añadido un escáner de códigos de barras integrado que permite importar billetes en papel a la aplicación.
  • Soporte para billetes de tarifa plana o tarjetas de programas de descuentos.
  • Importación de consultas de viaje en línea.
  • Importación o exportación de eventos al calendario del sistema de una reunión o del trabajo.
  • Opción de rutas alternativas está disponible ahora para una determinada parte de un viaje.

En los próximo días seguiré comentando las novedades de este gran lanzamiento.

La entrada Las novedades de KDE Itinerary de KDE Gear 22.08 se publicó primero en KDE Blog.

a silhouette of a person's head and shoulders, used as a default avatar

Unos pequeños trucos con el cursor en tu terminal con estos scripts

Como divertimento vamos a ver unos «simples» scripts para nuestra terminal de GNU/Linux que mostrarán unos curiosos movimientos del cursor en la pantalla

Imagen: Ondiz Zárraga

Por estas latitudes continuamos en verano y con calor, apetece relajarse y disfrutar. También con nuestro sistema GNU/Linux apetece «frikear» un poco.

En esta ocasión os traigo unos cuantos scripts en Bash, que hacen que nuestra terminal se comporte de manera extraña y tengamos un cursor que no pare de rebotar en la pantalla, otro que además lo hace a todo color, ver matrix en la terminal o incluso que nieve…

Todos estos scripts los he cogido prestados de la web climagic, y que estos y mucho más material lo puedes encontrar en este enlace:

Abre una terminal con Bash como Shell (si como yo usas Fish, hay un par de scripts que los he «traducido» para que funcionen en esta shell), maximízala para que se vea grande y copia y pega los scripts que se detallan:

Un cursor que no para de rebotar

En Bash ejecuta el siguiente script:

x=1;y=1;xd=1;yd=1;while true;do if [[ $x == $LINES || $x == 0 ]]; then xd=$(( $xd *-1 )) ; fi ; if [[ $y == $COLUMNS || $y == 0 ]]; then yd=$(( $yd * -1 )) ; fi ; x=$(( $x + $xd )); y=$(( $y + $yd )); printf "\33[%s;%sH" $x $y; sleep 0.02 ;done 

Como yo uso la shell Fish, he traducido el script para que funcione en esta Shell. Si como yo usas Fish, copia y pega lo siguiente:

set x 1 ; set y 1; set xd 1; set yd 1; while true; if test $x -eq $LINES; or test $x -eq 0; set xd $(math $xd \* -1 ); end; if test $y -eq $COLUMNS; or test $y -eq 0;set yd $(math $yd \* -1 ); end;set x $(math $x + $xd );set y $(math $y + $yd );printf "\33[%s;%sH" $x $y;sleep 0.02;end

Cursor rebotando a todo color dejando una estela

Una pequeña variante del anterior, ahora el cursor por donde pasa deja una estela multicolor. En Bash copia y pega lo siguiente:

a=1;x=1;y=1;xd=1;yd=1;while true;do if [[ $x == $LINES || $x == 0 ]]; then xd=$(( $xd *-1 )) ; fi ; if [[ $y == $COLUMNS || $y == 0 ]]; then yd=$(( $yd * -1 )) ; fi ; x=$(( $x + $xd )); y=$(( $y + $yd )); printf "\33[%s;%sH\33[48;5;%sm \33[0m" $x $y $(($a%199+16)) ;a=$(( $a + 1 )) ; sleep 0.001 ;done 

También este script lo he traducido para Fish. Si usas Fish copia y pega lo siguiente:

set a 1;set x 1;set y 1;set xd 1;set yd 1;while true;if test $x -eq $LINES;or test $x -eq 0;set xd $(math $xd \*-1 );end;if test $y -eq $COLUMNS;or test $y -eq 0;set yd $(math $yd \* -1 );end;set x $(math $x + $xd );set y $(math $y + $yd );printf "\33[%s;%sH\33[48;5;%sm \33[0m" $x $y $(math $a%199+16);set a $(math $a + 1 );sleep 0.001;end 

Salvapantallas para la terminal

Crea un patrón de colores a pantalla completa. En bash, copia y pega lo siguiente:

j=0;a=1;x=1;y=1;xd=1;yd=1;while true;do for i in {1..2000} ; do if [[ $x == $LINES || $x == 0 ]]; then xd=$(( $xd *-1 )) ; fi ; if [[ $y == $COLUMNS || $y == 0 ]]; then yd=$(( $yd * -1 )) ; fi ; x=$(( $x + $xd )); y=$(( $y + $yd )); printf "\33[%s;%sH\33[48;5;%sm . \33[0m" $x $y $(( $a % 8 + 16 + $j % 223 )) ;a=$(( $a + 1 )) ; done ; x=$(( x%$COLUMNS + 1 )) ; j=$(( $j + 8 )) ;done 

Para este script no lo he «traducido» a Fish ¿Te atreves tu? Si lo haces compártelo en los comentarios. 🙂

Puerta psicodélica a otra dimensión

En Bash ejecuta lo siguiente:

clear;x=$(($COLUMNS/2));y=$(($LINES/2));c=0;n=1;a=90;while :;do bgc=$(($c%232 + 16));case "$a" in 0)xd=0;yd=-1;n=$(($n+1));; 90)xd=1;yd=0;; 180)xd=0;yd=1;n=$(($n+1));; 270)xd=-1;yd=0 ;; *) break ;; esac; for ((i=0;i < $n;i++));do if [[ $x -ge $COLUMNS || $x -le 0 || $y -ge $LINES || $y -le 0 ]]; then x=$(($COLUMNS/2));y=$(($LINES/2));n=1;a=0; continue ; fi ; printf "\033[%s;%sH\033[48;5;%sm \033[0m" $y $x $bgc ; x=$(( $x + $xd )); y=$(( $y + $yd )); done ; c=$(( $c + 1 )); a=$(( $(( $a + 90 )) % 360 )) ; sleep 0.001; done

Matrix en tu terminal

En Bash copia y pega lo siguiente para ver Matrix igual que Neo…

echo -e "\e[1;40m" ; clear ; while :; do echo $LINES $COLUMNS $(( $RANDOM % $COLUMNS)) $( printf "\U$(( $RANDOM % 500 ))" ) ;sleep 0.05; done|gawk '{c=$4; letter=$4;a[$3]=0;for (x in a) {o=a[x];a[x]=a[x]+1; printf "\033[%s;%sH\033[2;32m%s",o,x,letter; printf "\033[%s;%sH\033[1;37m%s\033[0;0H",a[x],x,letter;if (a[x] >= $1) { a[x]=0; } }}' 

Está nevando en la terminal

Por Europa hay una gran falta de agua y mucho calor, podemos consolarnos viendo como nieva en nuestra terminal. Con Bash usa cualquiera de estas opciones:

clear;while :;do echo $LINES $COLUMNS $(($RANDOM%$COLUMNS)) $(printf "\u2744\n");sleep 0.1;done|gawk '{a[$3]=0;for(x in a) {o=a[x];a[x]=a[x]+1;printf "\033[%s;%sH ",o,x;printf "\033[%s;%sH%s \033[0;0H",a[x],x,$4;}}' 

o esta:

for((I=0;J=--I;))do clear;for((D=LINES;S=++J**3%COLUMNS,--D;))do printf %*s.\\n $S;done;sleep 0.1;done

Esto es todo por hoy. Pueden parecer scripts sencillos, pero verás que tienen «miga» y muchas cosas que podemos aprender viendo cómo funcionan. Te animo a que crees tus propios scripts a partir de estos, o que te animes a probar con distintos valores y opciones estos mismos.

Te recuerdo que todos estos scripts y muchos más los tienes disponibles en este enlace:

a silhouette of a person's head and shoulders, used as a default avatar

Las novedades de Kalendar de KDE Gear 22.08

La Comunidad KDE anunció hace unos días que había sido lanzado KDE Gear 22.08, la gran actualización de sus aplicaciones que tiene una periodicidad cuatrimestral. De esta forma, se nos presentan decenas de cambios importantes, una ingente cantidad de bugs solucionados y mejoras en las traducciones. Es hora de ir descubriendo poco a poco cuáles han sido. Ayer empezamos con Spectacle, el capturador de pantalla del escritorio Plasma, y hoy seguimos con las novedades de Kalendar de KDE Gear 22.08, la competencia directa del módulo KOrganizer de Kontact.

Las novedades de Kalendar de KDE Gear 22.08

Dentro del lanzamiento de KDE Gear 22.08 muchas aplicaciones han recibido mucho cariño, y una de ellas ha sido Kalendar un programa que nació con con el ánimo de tener una calendario simple y efectivo en nuestro equipos, y parece que lo está consiguiendo.

Las novedades de Kalendar de KDE Gear 22.08

Fue presentado hace un tiempo en el blog, y como decía anteriormente, Kalendar viene a ser una aplicación de calendario que nos permite gestionar tus tareas y eventos, soportando tanto calendarios locales como una multitud de calendarios en línea: Nextcloud, Google® Calendar, Outlook®, Caldav, y muchos más.

La rececpción de la aplicación ha sido muy buena y su evolución parece ir a un ritmo adecuado, como podemos comprobar más abajo, adquiriendo funcionalidades bastante interesantes.

Siendo precisos, las novedades de Spectacle de KDE Gear 22.08 son las siguientes:

  • Soporte de contactos: Al igual que los calendarios, puede añadir libretas de direcciones desde una amplia variedad de fuentes y verlas desde un widget del escritorio o del panel.
  • Posibilidad de generar códigos QR de los contactos para el caso de que quisiera compartirlos con un dispositivo móvil.
  • Mejoras en la vista del calendario: ahora puede ver las subtareas y las tareas principales en la barra lateral de tareas, lo que facilita la navegación entre ellas.

En los próximo días seguiré comentando las novedades de este gran lanzamiento.

La entrada Las novedades de Kalendar de KDE Gear 22.08 se publicó primero en KDE Blog.

a silhouette of a person's head and shoulders, used as a default avatar

Apache 2 prefork から event への乗り換え

はじめに

先日、C100 と Geeko Magazine の告知を出した際、geeko.jp のウェブサーバーが落ちてしまいました。普段は全然問題ないのですが、512 MB の VPS のため、ほんの少しアクセスが増えるとメモリーを使い果たしてしまうようです。

openSUSE の Web サーバーは 2009 年頃から使い続けていることもあって Apache で、しかも MPM (Multi-processing modules) は prefork です。複数のアクセスに対してプロセスを作成して対応するので、メモリー使用量やプロセスの生成コストが課題です。設定変更前のメモリー使用量を見ると次のような状態で、1プロセスあたり 30 MB 前後使っています。とりあえずの対策としては、プロセスの最大数を抑えればよいのですが、メモリー使用量削減のため、これを機に MPM を event にすることにしました。

# smem -U wwwrun -k
  PID User     Command                         Swap      USS      PSS      RSS 
26053 wwwrun   /usr/sbin/httpd-prefork -DS    24.2M   576.0K     1.3M     9.5M 
23952 wwwrun   /usr/sbin/httpd-prefork -DS    14.5M    20.8M    21.7M    30.4M 
26051 wwwrun   /usr/sbin/httpd-prefork -DS     5.6M    23.5M    24.4M    32.9M 
23953 wwwrun   /usr/sbin/httpd-prefork -DS     6.3M    23.7M    24.4M    31.8M 
 2023 wwwrun   /usr/sbin/httpd-prefork -DS     5.4M    24.0M    24.8M    32.7M 
 7054 wwwrun   /usr/sbin/httpd-prefork -DS     7.5M    26.0M    26.8M    35.0M 
23955 wwwrun   /usr/sbin/httpd-prefork -DS     5.0M    32.6M    33.6M    42.2M 
23956 wwwrun   /usr/sbin/httpd-prefork -DS     5.5M    34.2M    34.9M    43.1M 
23959 wwwrun   /usr/sbin/httpd-prefork -DS     5.5M    34.4M    35.3M    43.8M 
 2022 wwwrun   /usr/sbin/httpd-prefork -DS     6.0M    34.7M    35.6M    43.6M

少し前までの Apache の MPM といえば worker で、スレッドを使って並列処理をします。私の知識もここで止まっていました。event は新しい MPM で、今どきのイベント駆動で実装されています。ワーカースレッド内で受信待ちやソケット書き込み待ちをせずに、パケット到着や書き込み可能になったイベントを受けてスレッドに処理を割り当てるようです。

MPM を prefork から event にするために必要なことは、次の通りです。

  • event MPM をインストールする
  • PHP を mod_php による実行から mod_proxy_fcgi + php_fpm (FastCGI) による実行に変える
  • php_fpm で Web アプリを実行できるように AppArmor のプロファイルを設定する

結構面倒くさいですね。

openSUSE のバージョンは Leap 15.4 です。

event MPM をインストールする

これは簡単で apache2-event をインストールするだけです。apache2-prefork もインストールされいる環境では、apache2-event が優先されます。

zypper in apache2-event

mod_proxy_fcgi + php_fpm への変更

これまでは mod_php でこの Word Press などを実行してきました。mod_php の場合、PHP のスクリプトは Apache のプロセスで実行されていました。マルチスレッドに対応していない mod_php は event や worker では使用できません。php_fpm で PHP を別プロセスで起動しておき、リクエスト時にこの PHP プロセスに処理を依頼する形に変更する必要があります。

セットアップ手順は以下の通りです。php7-fpm をインストールして、パッケージに含まれるデフォルトの設定を有効化します。

zypper in php7-fpm

cd /etc/php7/fpm
mv php-fpm.conf.default php-fpm.conf
cd php-fpm.d
mv www.conf.default www.conf

systemctl enable php-fpm
systemctl start php-fpm

Apache 側の設定を変えます。openSUSE では Apache で使用するモジュールは /etc/sysconfig/apache2 で有効化します。php7 を削除し、proxy と proxy_fcgi を追加します。

APACHE_MODULES="(省略)proxy proxy_fcgi"

次に、php ファイルのハンドリングを mod_php から php_fpm に切り替えます。/etc/apache2/conf.d/ に以下のファイルを作成します。openSUSE のデフォルト設定では php7_fpm は 9000 で待ち受けていますので、php へのアクセスを 127.0.0.1:9000 に転送するようにします。

ProxyErrorOverride on は php_fpm がエラーを返した場合に、php_fpm のエラーメッセージをそのままブラウザに返すのではなく、Apache 側で設定したエラー画面を表示するための設定です。

<filesmatch "\.ph(p[3457]?|tml)$"="">
SetHandler "proxy:fcgi://127.0.0.1:9000"
</filesmatch>
<filesmatch "\.php[3457]?s$"="">
SetHandler application/x-httpd-php-source
</filesmatch>
DirectoryIndex index.php4
DirectoryIndex index.php5
DirectoryIndex index.php7
DirectoryIndex index.php
ProxyErrorOverride on

AppArmor の設定変更

openSUSE Leap 15.4 では php_fpm 用の AppArmor プロファイルが含まれており、php_fpm が行える操作に制限がかかっています。そのため、何も設定しないと、php-fpm が php ファイルにアクセスできません。/var/log/audit/ に次のようなログが出力され、403 が返ります。

type=AVC msg=audit(1661003085.840:89050): apparmor="DENIED" operation="open" profile="php-fpm" name="/srv/www/htdocs/index.php" pid=20329 comm="php-fpm" requested_mask="r" denied_mask="r" fsuid=498 ouid=498

php_fpm のプロファイルを調整するには、/etc/apparmor.d/php-fpm.d/ に次のような設定ファイルを作成し、php-fpm がアクセスできるディレクトリを設定します。

# tmp へのアクセス
  include <abstractions user-tmp="">
  # htdocs への読み書き
  # 読み取りだけであれば <abstractions/web-data> もあり
  owner /srv/www/htdocs/** rw,

結果

設定後にメモリー使用量を見てみます。

PID User     Command                         Swap      USS      PSS      RSS
29193 wwwrun   /usr/sbin/httpd-event -DSYS   208.0K   804.0K     1.3M     4.9M
29195 wwwrun   /usr/sbin/httpd-event -DSYS   208.0K     1.6M     2.8M    11.0M
29194 wwwrun   /usr/sbin/httpd-event -DSYS   208.0K     1.6M     2.8M    11.1M
29196 wwwrun   /usr/sbin/httpd-event -DSYS   208.0K     2.2M     3.4M    11.6M
29278 wwwrun   /usr/sbin/httpd-event -DSYS   208.0K     3.2M     4.4M    12.7M
29094 wwwrun   php-fpm: pool www             208.0K    25.3M    30.3M    47.1M
29306 wwwrun   php-fpm: pool www             208.0K    33.8M    38.4M    54.5M
29337 wwwrun   php-fpm: pool www             208.0K    35.6M    39.5M    54.0M

php-fpm のプロセスが増えましたが、Apache のプロセスのメモリー使用量はぐっと小さくなりました。Apache と php-fpm の初期プロセス数、最大プロセス数はこれから調整したいと思います。

a silhouette of a person's head and shoulders, used as a default avatar

Las novedades de Spectacle de KDE Gear 22.08

La Comunidad KDE anunció hace unos días que había sido lanzado KDE Gear 22.08, la gran actualización de sus aplicaciones que tiene una periodicidad cuatrimestral. De esta forma, se nos presentan decenas de cambios importantes, una ingente cantidad de bugs solucionados y mejoras en las traducciones. Es hora de ir descubriendo poco a poco cuáles han sido y empezamos con las noveades de Spectacle, el capturador de pantalla del escritorio Plasma..

Las novedades de Spectacle de KDE Gear 22.08

Dentro del lanzamiento de KDE Gear 22.08 una de las aplicaciones que más mimo ha recibido ha sido Spectacle, un programa que nació con  KDE Applications 15.12.

Las novedades de Spectacle de KDE Gear 22.08

Para los que no lo sepan se trata de un capturador de pantalla de la Comnidad KDE heredero del mítico KSnapshot, que ofrecía las mismas funcionalidades que éste pero con un código adaptado a KDE Frameworks 5. El funcionamiento de Spectacle fue perfecto desde el principio y reemplazó sin ningún problema a su antecesor, siendo una de las transiciones más suaves entre aplicaciones «oficiales» que recuerdo.

No está de más recordar que Spectacle puede capturar el escritorio completo, el monitor que deseemos, la ventana activa o una región determinada del mismo. Todo ello con opciones de temporización, atajos de teclado o posibilidad de compartir con otras aplicaciones, y en sus últimas versiones incorpora un completo editor de imágenes integrado para crear capturas completas, al cual le dediqué unas entradas hace poco.

Las novedades de Spectacle de KDE Gear 22.08 son las siguientes:

La entrada Las novedades de Spectacle de KDE Gear 22.08 se publicó primero en KDE Blog.