My smaller backpack has ski slots on each side, a scabbard fits nicely in them. A cut down Marlin levergun rode there for many a mile.

After that, I make my own slings using 2″ webbing.
Stitching a little Velcro on the inside of the sling and on the pack strap keeps the rifle in place. Perhaps a little too well, I stopped this a while back and went to a layer of ShoeGoo on the inside of the sling where it goes over the shoulder.

Just sticky or tacky enough to stay in place, easy to repair and dirt cheap.