Попробуйте это, заменив $HOME и $PROFILE на vapid-значения и сохраните их до ~/.init с разрешения 644.
Прежде чем что-либо сделать, убедитесь, что в /etc/fstab имеется строка типа
firefox /home/your_name/.mozilla/firefox/your_profile.default tmpfs size=128M,noauto,user,exec,uid=1000,gid=100 0 0
, где опция mount noauto предотвращает автоматическое монтирование tmpfs, что можно изменить на auto по вашему усмотрению. Я оставляю его там, чтобы сохранить всю работу выскочки в целостности.
description "automatic firefox profile ram caching"
start on started mountall
stop on stopping mountall
env HOME="/home/your_name"
env PROFILE="your_profile.default"
script
if test -z "$(mount | grep -F "${HOME}/.mozilla/firefox/${PROFILE}" )"
then
mount "${HOME}/.mozilla/firefox/${PROFILE}"
fi
end script
post-start script
cd "${HOME}/.mozilla/firefox"
if test -f packed.tar
then
tar xpf packed.tar
echo "$(date): firefox profile unpacked to ram" >> unpack.log
else
tar xpf packed.tar.old
echo "$(date): backup profile unpacked to ram" >> unpack.log
fi
touch "${PROFILE}/.unpacked"
end script
pre-stop script
cd "${HOME}/.mozilla/firefox"
if test -f "${PROFILE}/.unpacked"
then
tar --exclude '.unpacked' -cpf packed.tmp.tar "$PROFILE"
mv packed.tar packed.tar.old
mv packed.tmp.tar packed.tar
rm "$PFORILE/.unpacked"
echo "$(date) firefox profile packed from ram" >> pack.log
else
echo ".unpacked is missing. pack current session data to newfile"
tar -cpf packed-$(date +%Y%m%d%H%M).tar "$PROFILE"
fi
end script
Вы также можете посмотреть man useradd.
sudo useradd -c 'this is Bob' -d /home/bob -g users -m -p 'aXjeklexjklrewj' bob
(NB: вы должны указать здесь зашифрованный пароль)
Вы также можете посмотреть man useradd.
sudo useradd -c 'this is Bob' -d /home/bob -g users -m -p 'aXjeklexjklrewj' bob
(NB: вы должны указать здесь зашифрованный пароль)
Вы также можете посмотреть man useradd.
sudo useradd -c 'this is Bob' -d /home/bob -g users -m -p 'aXjeklexjklrewj' bob
(NB: вы должны указать здесь зашифрованный пароль)
Предполагая, что с помощью «комментария» вы ссылаетесь на запись в поле GECOS, вы можете сделать это, используя команду newusers. Из man newusers:
NAME
newusers - update and create new users in batch
SYNOPSIS
newusers [options] [file]
DESCRIPTION
The newusers command reads a file (or the standard input by default)
and uses this information to update a set of existing users or to
create new users. Each line is in the same format as the standard
password file (see passwd(5)) with the exceptions explained below:
pw_name:pw_passwd:pw_uid:pw_gid:pw_gecos:pw_dir:pw_shell
Пример
$ sudo newusers << EOF
bob:12$dta%:::comment:/home/bob:/bin/bash
EOF
[sudo] password for steeldriver:
Проверка
$ getent passwd bob
bob:x:1002:1002:comment:/home/bob:/bin/bash
$ ls -ld /home/bob
drwxr-xr-x 2 bob bob 4096 Nov 29 20:25 /home/bob
Предполагая, что с помощью «комментария» вы ссылаетесь на запись в поле GECOS, вы можете сделать это, используя команду newusers. Из man newusers:
NAME
newusers - update and create new users in batch
SYNOPSIS
newusers [options] [file]
DESCRIPTION
The newusers command reads a file (or the standard input by default)
and uses this information to update a set of existing users or to
create new users. Each line is in the same format as the standard
password file (see passwd(5)) with the exceptions explained below:
pw_name:pw_passwd:pw_uid:pw_gid:pw_gecos:pw_dir:pw_shell
Пример
$ sudo newusers << EOF
bob:12$dta%:::comment:/home/bob:/bin/bash
EOF
[sudo] password for steeldriver:
Проверка
$ getent passwd bob
bob:x:1002:1002:comment:/home/bob:/bin/bash
$ ls -ld /home/bob
drwxr-xr-x 2 bob bob 4096 Nov 29 20:25 /home/bob
Предполагая, что с помощью «комментария» вы ссылаетесь на запись в поле GECOS, вы можете сделать это, используя команду newusers. Из man newusers:
NAME
newusers - update and create new users in batch
SYNOPSIS
newusers [options] [file]
DESCRIPTION
The newusers command reads a file (or the standard input by default)
and uses this information to update a set of existing users or to
create new users. Each line is in the same format as the standard
password file (see passwd(5)) with the exceptions explained below:
pw_name:pw_passwd:pw_uid:pw_gid:pw_gecos:pw_dir:pw_shell
Пример
$ sudo newusers << EOF
bob:12$dta%:::comment:/home/bob:/bin/bash
EOF
[sudo] password for steeldriver:
Проверка
$ getent passwd bob
bob:x:1002:1002:comment:/home/bob:/bin/bash
$ ls -ld /home/bob
drwxr-xr-x 2 bob bob 4096 Nov 29 20:25 /home/bob