Codebase list sysvinit / aa530d8
Merge branch 'shm' Roger Leigh 11 years ago
3 changed file(s) with 60 addition(s) and 16 deletion(s). Raw diff Collapse all Expand all
77 - To permit enabling of dependency-based boot, add Breaks on older
88 versions of bootchart. Thanks to Andreas Beckmann.
99 Closes: #694252.
10 - To work around a bug in the Oracle database, which has a faulty
11 check for /dev/shm, continue to mount a tmpfs on /dev/shm rather
12 than /run/shm if one is defined in /etc/fstab. Closes: #694379.
1013
1114 -- David Prévot <taffit@debian.org> Wed, 28 Nov 2012 21:15:34 -0400
1215
423423 # directory. The migration logic will then take care of the
424424 # rest. Note that it will take a second boot to fully
425425 # migrate; it should only ever be needed on broken systems.
426 RAMSHM_ON_DEV_SHM="no"
427 if read_fstab_entry "/dev/shm"; then
428 RAMSHM_ON_DEV_SHM="yes"
429 fi
430 if read_fstab_entry "/run/shm"; then
431 RAMSHM_ON_DEV_SHM="no"
432 fi
433
426434 if [ -L /run ]; then
427435 if [ "$(readlink /run)" = "/var/run" ]; then
428436 rm -f /run
430438 fi
431439 if bind_mount /var/run /run; then
432440 bind_mount /var/lock /run/lock
433 bind_mount /dev/shm /run/shm
441 if [ yes = "$RAMSHM_ON_DEV_SHM" ]; then
442 run_migrate /run/shm /dev/shm
443 else
444 run_migrate /dev/shm /run/shm
445 fi
434446 fi
435447 else
436448 run_migrate /var/run /run
437449 run_migrate /var/lock /run/lock
438 run_migrate /dev/shm /run/shm
450 if [ yes = "$RAMSHM_ON_DEV_SHM" ]; then
451 run_migrate /run/shm /dev/shm
452 else
453 run_migrate /dev/shm /run/shm
454 fi
439455 fi
440456 }
441457
511527 {
512528 MNTMODE="$1"
513529
514 if [ ! -d /run/shm ]
530 RAMSHM_ON_DEV_SHM="no"
531 SHMDIR="/run/shm"
532 if read_fstab_entry "/dev/shm"; then
533 if [ "$MNTMODE" = "mount_noupdate" ]; then
534 log_warning_msg "Warning: fstab entry for /dev/shm; should probably be for /run/shm unless working around a bug in the Oracle database"
535 fi
536 SHMDIR="/dev/shm"
537 RAMSHM_ON_DEV_SHM="yes"
538 fi
539 if read_fstab_entry "/run/shm"; then
540 if [ "$MNTMODE" = "mount_noupdate" ] && [ "$RAMSHM_ON_DEV_SHM" ]; then
541 log_warning_msg "Warning: fstab entries for both /dev/shm and /run/shm found; only /run/shm will be used"
542 fi
543
544 SHMDIR="/run/shm"
545 RAMSHM_ON_DEV_SHM="no"
546 fi
547
548 if [ ! -d "$SHMDIR" ]
515549 then
516 mkdir --mode=755 /run/shm
517 [ -x /sbin/restorecon ] && /sbin/restorecon /run/shm
550 mkdir --mode=755 "$SHMDIR"
551 [ -x /sbin/restorecon ] && /sbin/restorecon "$SHMDIR"
518552 fi
519553
520554 # Now check if there's an entry in /etc/fstab. If there is,
521555 # it overrides the existing RAMSHM setting.
522 if read_fstab_entry /run/shm; then
523 if [ "$MNT_TYPE" = "tmpfs" ] ; then
524 RAMSHM="yes"
525 else
526 RAMSHM="no"
527 fi
556 if read_fstab_entry "$SHMDIR"; then
557 if [ "$MNT_TYPE" = "tmpfs" ] ; then
558 RAMSHM="yes"
559 else
560 RAMSHM="no"
561 fi
528562 fi
529563
530564 KERNEL="$(uname -s)"
534568 esac
535569
536570 if [ yes = "$RAMSHM" ]; then
537 domount "$MNTMODE" tmpfs shmfs /run/shm tmpfs "-onosuid,${NODEV}noexec$SHM_OPT"
571 domount "$MNTMODE" tmpfs shmfs "$SHMDIR" tmpfs "-onosuid,${NODEV}noexec$SHM_OPT"
538572 # Make sure we don't get cleaned
539 touch /run/shm/.tmpfs
573 touch "$SHMDIR"/.tmpfs
540574 else
541 chmod "$SHM_MODE" /run/shm
575 chmod "$SHM_MODE" "$SHMDIR"
542576 fi
543577
544578 # Migrate early, so /dev/shm is available from the start
545579 if [ "$MNTMODE" = mount_noupdate ] || [ "$MNTMODE" = mount ]; then
546 run_migrate /dev/shm /run/shm ../run/shm
580 if [ yes = "$RAMSHM_ON_DEV_SHM" ]; then
581 run_migrate /run/shm /dev/shm
582 else
583 run_migrate /dev/shm /run/shm
584 fi
547585 fi
548586 }
549587
7575 Packages can not expect directories in /run/shm to exist after boot.
7676 Note that /run/shm was previously /dev/shm, and a compatibility
7777 symlink or bind mount will be created to allow the old path to
78 continue to function.
78 continue to function. If an fstab entry for /dev/shm exists instead
79 of /run/shm, then /dev/shm will continue to be used; note that this is
80 only needed for users of newer versions of the Oracle database, which
81 contain a buggy check for /dev/shm.
7982
8083 .IP /tmp
8184 Previously configured using \fBRAMTMP\fP in /etc/default/rcS. Note